Kafka メトリクスレシーバー 🔗
Kafkaメトリクスレシーバーは、KafkaサーバーからKafkaメトリクス(ブローカー、トピック、パーティション、コンシューマーグループなど)を収集し、OTLP形式に変換します。サポートされるパイプラインタイプは metrics
です。詳細は パイプラインでデータを処理する を参照してください。
注釈
すぐに使えるダッシュボードとナビゲーターはまだKafkaメトリクスレシーバーではサポートされていませんが、将来のリリースではサポートされる予定です。
はじめに 🔗
以下の手順に従って、コンポーネントの設定とアクティベーションを行ってください:
Splunk Distribution of the OpenTelemetry Collector をホストまたはコンテナプラットフォームにデプロイします:
次のセクションで説明するようにレシーバーを設定します。
Collector を再起動します。
サンプル構成 🔗
Kafkaメトリクスレシーバーを有効にするには、次の例のように、設定ファイルの kafkametrics
セクションに receivers
を追加します:
receivers:
kafkametrics:
protocol_version: 2.0.0
scrapers:
- brokers
- topics
- consumers
コンフィギュレーションを完了するには、コンフィギュレーションファイルの service
セクションの metrics
パイプラインに、レシーバーを含めます。例:
service:
pipelines:
metrics:
receivers: [kafkametrics]
設定オプション 🔗
以下の設定が必要です:
protocol_version
。デフォルトはありません。Kafkaプロトコルバージョン、たとえば2.0.0
。scrapers
。デフォルトはありません。以下のスクレイパーの任意の組み合わせを有効にできます:topics
consumers
brokers
以下の設定はオプションです:
brokers
デフォルトではlocalhost:9092
。読み込み元のブローカーのリスト。resolve_canonical_bootstrap_servers_only
。デフォルトではfalse
です。起動時にブローカーIPを解決してから逆引きするかどうかを決定します。topic_match
。デフォルトでは^[^_].*$)
です。メトリクスコレクションでフィルターリングするトピックの正規表現パターン。デフォルトのフィルターでは、_
で始まる内部トピックは除外されます。group_match
。デフォルトでは.*)
です。メトリクス用にフィルターリングする消費者グループの正規表現パターン。client_id
。デフォルトではotel-metrics-receiver
です。消費者クライアントID。collection_interval
。デフォルトでは1m
です。メトリクス収集/スクレイピングの頻度。initial_delay
。デフォルトでは1s
です。このレシーバーが開始するまでの待ち時間を決定します。auth
。デフォルトはありません。以下のいずれかを使用します:plain_text
。以下のフィールドがあります:username
。使用するユーザー名。password
。使用するパスワード。
tls
。以下のフィールドがあります:ca_file
。insecure
がfalse
に設定されている場合のみ使用します。CA証明書へのパス。クライアントでは、サーバー証明書を検証します。cert_file
。insecure
がfalse
に設定されている場合のみ使用します。TLSが必要な接続に使用するTLS認証へのパス。key_file
。insecure
がfalse
に設定されている場合のみ使用します。TLSが必要な接続に使用するTLSキーへのパス。insecure
。デフォルトではfalse
です。tls設定で、サーバーの証明書チェーンとホスト名、InsecureSkipVerify
の検証を無効にします。server_name_override
。バーチャルホスティングをサポートするためにクライアントが要求したサーバー名を示します。
kerberos
。以下のフィールドがあります:service_name
。Kerberosサービス名。realm
。Kerberosレルム。use_keytab
。true
の場合、パスワードの代わりにkeytabが使われます。username
。KDCでの認証に使用するKerberosユーザー名。password
。KDCでの認証に使用するKerberosパスワード。config_file
。Kerberos設定へのパス、例えば/etc/krb5.conf
。keytab_file
。keytabファイルへのパス、例えば/etc/security/kafka.keytab
。disable_fast_negotiation
。デフォルトではfalse
です。PA-FX-FASTネゴシエーション(Pre-Authentication Framework - Fast)を無効にします。一部の一般的なKerberos実装はPA-FX-FASTネゴシエーションをサポートしていません。
設定例:認証と収集間隔を5秒に設定します 🔗
この例では、すべてのスクレイパーの収集間隔を5秒に設定し、TLS認証を設定しています:
receivers:
kafkametrics:
brokers: 10.10.10.10:9092
protocol_version: 2.0.0
scrapers:
- brokers
- topics
- consumers
auth:
tls:
ca_file: ca.pem
cert_file: cert.pem
key_file: key.pem
collection_interval: 5s
設定 🔗
以下の表に、Kafkaメトリクスレシーバーの設定オプションを示します:
Name | Type | Default | Description |
---|---|---|---|
collection_interval | int64 | 1m0s | CollectionInterval sets how frequently the scraper should be called and used as the context timeout to ensure that scrapers don't exceed the interval. |
initial_delay | int64 | 1s | InitialDelay sets the initial start delay for the scraper, any non positive value is assumed to be immediately. |
timeout | int64 | Timeout is an optional value used to set scraper's context deadline. | |
cluster_alias | string | Alias name of the kafka cluster | |
brokers | slice | The list of kafka brokers (default localhost:9092) | |
resolve_canonical_bootstrap_servers_only | bool | false | ResolveCanonicalBootstrapServersOnly makes Sarama do a DNS lookup for each of the provided brokers. It will then do a PTR lookup for each returned IP, and that set of names becomes the broker list. This can be required in SASL environments. |
protocol_version | string | ProtocolVersion Kafka protocol version | |
topic_match | string | ^[^_].*$ | TopicMatch topics to collect metrics on |
group_match | string | .* | GroupMatch consumer groups to collect on |
auth (see fields) | struct | Authentication data | |
scrapers | slice | Scrapers defines which metric data points to be captured from kafka | |
client_id | string | otel-metrics-receiver | ClientID is the id associated with the consumer that reads from topics in kafka. |
metrics (see fields) | struct | MetricsConfig provides config for kafkametrics metrics. | |
resource_attributes (see fields) | struct | ResourceAttributesConfig provides config for kafkametrics resource attributes. |
Fields of auth
Name | Type | Default | Description |
---|---|---|---|
plain_text (see fields) | ptr | PlainTextConfig defines plaintext authentication. | |
sasl (see fields) | ptr | SASLConfig defines the configuration for the SASL authentication. | |
tls (see fields) | ptr | ClientConfig contains TLS configurations that are specific to client connections in addition to the common configurations. This should be used by components configuring TLS client connections. | |
kerberos (see fields) | ptr | KerberosConfig defines kerberos configuration. |
Fields of plain_text
Name | Type | Default | Description |
---|---|---|---|
username | string | ||
password | string |
Fields of sasl
Name | Type | Default | Description |
---|---|---|---|
username | string | Username to be used on authentication | |
password | string | Password to be used on authentication | |
mechanism | string | SASL Mechanism to be used, possible values are: (PLAIN, AWS_MSK_IAM, SCRAM-SHA-256 or SCRAM-SHA-512). | |
version | int | SASL Protocol Version to be used, possible values are: (0, 1). Defaults to 0. | |
aws_msk (see fields) | struct | AWSMSKConfig defines the additional SASL authentication measures needed to use AWS_MSK_IAM mechanism |
Fields of aws_msk
Name | Type | Default | Description |
---|---|---|---|
region | string | Region is the AWS region the MSK cluster is based in | |
broker_addr | string | BrokerAddr is the client is connecting to in order to perform the auth required |
Fields of tls
Name | Type | Default | Description |
---|---|---|---|
ca_file | string | Path to the CA cert. For a client this verifies the server certificate. For a server this verifies client certificates. If empty uses system root CA. (optional) | |
ca_pem | string | In memory PEM encoded cert. (optional) | |
include_system_ca_certs_pool | bool | false | If true, load system CA certificates pool in addition to the certificates configured in this struct. |
cert_file | string | Path to the TLS cert to use for TLS required connections. (optional) | |
cert_pem | string | In memory PEM encoded TLS cert to use for TLS required connections. (optional) | |
key_file | string | Path to the TLS key to use for TLS required connections. (optional) | |
key_pem | string | In memory PEM encoded TLS key to use for TLS required connections. (optional) | |
min_version | string | MinVersion sets the minimum TLS version that is acceptable. If not set, TLS 1.2 will be used. (optional) | |
max_version | string | MaxVersion sets the maximum TLS version that is acceptable. If not set, refer to crypto/tls for defaults. (optional) | |
cipher_suites | slice | CipherSuites is a list of TLS cipher suites that the TLS transport can use. If left blank, a safe default list is used. See https://go.dev/src/crypto/tls/cipher_suites.go for a list of supported cipher suites. | |
reload_interval | int64 | ReloadInterval specifies the duration after which the certificate will be reloaded If not set, it will never be reloaded (optional) | |
insecure | bool | false | In gRPC and HTTP when set to true, this is used to disable the client transport security. See https://godoc.org/google.golang.org/grpc#WithInsecure for gRPC. Please refer to https://godoc.org/crypto/tls#Config for more information. (optional, default false) |
insecure_skip_verify | bool | false | InsecureSkipVerify will enable TLS but not verify the certificate. |
server_name_override | string | ServerName requested by client for virtual hosting. This sets the ServerName in the TLSConfig. Please refer to https://godoc.org/crypto/tls#Config for more information. (optional) |
Fields of kerberos
Name | Type | Default | Description |
---|---|---|---|
service_name | string | ||
realm | string | ||
use_keytab | bool | false | |
username | string | ||
password | string | ||
config_file | string | ||
keytab_file | string | ||
disable_fast_negotiation | bool | false |
Fields of metrics
Name | Type | Default | Description |
---|---|---|---|
kafka.broker.log_retention_period | struct | MetricConfig provides common config for a particular metric. | |
kafka.brokers | struct | MetricConfig provides common config for a particular metric. | |
kafka.consumer_group.lag | struct | MetricConfig provides common config for a particular metric. | |
kafka.consumer_group.lag_sum | struct | MetricConfig provides common config for a particular metric. | |
kafka.consumer_group.members | struct | MetricConfig provides common config for a particular metric. | |
kafka.consumer_group.offset | struct | MetricConfig provides common config for a particular metric. | |
kafka.consumer_group.offset_sum | struct | MetricConfig provides common config for a particular metric. | |
kafka.partition.current_offset | struct | MetricConfig provides common config for a particular metric. | |
kafka.partition.oldest_offset | struct | MetricConfig provides common config for a particular metric. | |
kafka.partition.replicas | struct | MetricConfig provides common config for a particular metric. | |
kafka.partition.replicas_in_sync | struct | MetricConfig provides common config for a particular metric. | |
kafka.topic.log_retention_period | struct | MetricConfig provides common config for a particular metric. | |
kafka.topic.log_retention_size | struct | MetricConfig provides common config for a particular metric. | |
kafka.topic.min_insync_replicas | struct | MetricConfig provides common config for a particular metric. | |
kafka.topic.partitions | struct | MetricConfig provides common config for a particular metric. | |
kafka.topic.replication_factor | struct | MetricConfig provides common config for a particular metric. |
Fields of kafka.broker.log_retention_period
Name | Type | Default | Description |
---|---|---|---|
enabled | bool | false |
Fields of kafka.brokers
Name | Type | Default | Description |
---|---|---|---|
enabled | bool | true |
Fields of kafka.consumer_group.lag
Name | Type | Default | Description |
---|---|---|---|
enabled | bool | true |
Fields of kafka.consumer_group.lag_sum
Name | Type | Default | Description |
---|---|---|---|
enabled | bool | true |
Fields of kafka.consumer_group.members
Name | Type | Default | Description |
---|---|---|---|
enabled | bool | true |
Fields of kafka.consumer_group.offset
Name | Type | Default | Description |
---|---|---|---|
enabled | bool | true |
Fields of kafka.consumer_group.offset_sum
Name | Type | Default | Description |
---|---|---|---|
enabled | bool | true |
Fields of kafka.partition.current_offset
Name | Type | Default | Description |
---|---|---|---|
enabled | bool | true |
Fields of kafka.partition.oldest_offset
Name | Type | Default | Description |
---|---|---|---|
enabled | bool | true |
Fields of kafka.partition.replicas
Name | Type | Default | Description |
---|---|---|---|
enabled | bool | true |
Fields of kafka.partition.replicas_in_sync
Name | Type | Default | Description |
---|---|---|---|
enabled | bool | true |
Fields of kafka.topic.log_retention_period
Name | Type | Default | Description |
---|---|---|---|
enabled | bool | false |
Fields of kafka.topic.log_retention_size
Name | Type | Default | Description |
---|---|---|---|
enabled | bool | false |
Fields of kafka.topic.min_insync_replicas
Name | Type | Default | Description |
---|---|---|---|
enabled | bool | false |
Fields of kafka.topic.partitions
Name | Type | Default | Description |
---|---|---|---|
enabled | bool | true |
Fields of kafka.topic.replication_factor
Name | Type | Default | Description |
---|---|---|---|
enabled | bool | false |
Fields of resource_attributes
Name | Type | Default | Description |
---|---|---|---|
kafka.cluster.alias | struct | ResourceAttributeConfig provides common config for a particular resource attribute. |
Fields of kafka.cluster.alias
Name | Type | Default | Description |
---|---|---|---|
enabled | bool | false | |
metrics_include (see fields) | slice | Experimental: MetricsInclude defines a list of filters for attribute values. If the list is not empty, only metrics with matching resource attribute values will be emitted. | |
metrics_exclude (see fields) | slice | Experimental: MetricsExclude defines a list of filters for attribute values. If the list is not empty, metrics with matching resource attribute values will not be emitted. MetricsInclude has higher priority than MetricsExclude. |
Fields of metrics_include
Name | Type | Default | Description |
---|---|---|---|
strict | string | ||
regexp | string |
Fields of metrics_exclude
Name | Type | Default | Description |
---|---|---|---|
strict | string | ||
regexp | string |
メトリクス 🔗
以下のメトリクス、リソース属性、および属性が使用できます。
Name | Type | Unit | Active | Description | Attributes |
---|---|---|---|---|---|
kafka.brokers | Sum | {brokers} | Yes | Number of brokers in the cluster. | |
kafka.broker.log_retention_period | Gauge | s | No | log retention time (s) of a broker. | |
kafka.topic.partitions | Sum | {partitions} | Yes | Number of partitions in topic. | |
kafka.topic.replication_factor | Gauge | No | replication factor of a topic. | ||
kafka.topic.log_retention_period | Gauge | s | No | log retention period of a topic (s). | |
kafka.topic.log_retention_size | Gauge | By | No | log retention size of a topic in Bytes, The value (-1) indicates infinite size. | |
kafka.topic.min_insync_replicas | Gauge | {replicas} | No | minimum in-sync replicas of a topic. | |
kafka.partition.current_offset | Gauge | Yes | Current offset of partition of topic. | ||
kafka.partition.oldest_offset | Gauge | Yes | Oldest offset of partition of topic | ||
kafka.partition.replicas | Sum | {replicas} | Yes | Number of replicas for partition of topic | |
kafka.partition.replicas_in_sync | Sum | {replicas} | Yes | Number of synchronized replicas of partition | |
kafka.consumer_group.members | Sum | {members} | Yes | Count of members in the consumer group | |
kafka.consumer_group.offset | Gauge | Yes | Current offset of the consumer group at partition of topic | ||
kafka.consumer_group.offset_sum | Gauge | Yes | Sum of consumer group offset across partitions of topic | ||
kafka.consumer_group.lag | Gauge | Yes | Current approximate lag of consumer group at partition of topic | ||
kafka.consumer_group.lag_sum | Gauge | Yes | Current approximate sum of consumer group lag across all partitions of topic |
Resource Attributes
Name | Type | Description |
---|---|---|
kafka.cluster.alias | string | The alias name (string) of the cluster |
Attributes
Name | Type | Description | Values |
---|---|---|---|
broker | string | The ID of the kafka broker |
|
topic | string | The ID (integer) of a topic |
|
partition | int | The number (integer) of the partition |
|
group | string | The ID (string) of a consumer group |
|
特定のメトリクスをアクティブまたは非アクティブにする 🔗
各メトリクスの metrics
セクションの enabled
フィールドを設定することで、特定のメトリクスをアクティブまたは非アクティブにできます。例:
receivers:
samplereceiver:
metrics:
metric-one:
enabled: true
metric-two:
enabled: false
以下は、アクティブ化されたメトリクスを持つホスト・メトリクス・レシーバーの構成例です:
receivers:
hostmetrics:
scrapers:
process:
metrics:
process.cpu.utilization:
enabled: true
注釈
無効化されたメトリクスは Splunk Observability Cloud に送信されません。
請求 🔗
MTSベースのサブスクリプションでは、すべてのメトリクスがメトリクスの使用量にカウントされます。
ホストベースのプランに加入している場合、このドキュメントでアクティブ(Active: Yes)と記載されているメトリクスはデフォルトとみなされ、無料で含まれます。
詳しくは Infrastructure Monitoringのサブスクリプション使用状況(ホストとメトリクスのプラン) を参照してください。
トラブルシューティング 🔗
Splunk Observability Cloudをご利用のお客様で、Splunk Observability Cloudでデータを確認できない場合は、以下の方法でサポートを受けることができます。
Splunk Observability Cloudをご利用のお客様
Splunk サポートポータル でケースを送信する
Splunkサポート に連絡する
見込み客および無料トライアルユーザー様
Splunk Answers のコミュニティサポートで質問し、回答を得る
Join the Splunk #observability user group Slack channel to communicate with customers, partners, and Splunk employees worldwide. To join, see Chat groups in the Get Started with Splunk Community manual.