Docs » Splunk Observability Cloud でサポートされているインテグレーション » Collectorコンポーネント: レシーバー » Kafka メトリクスレシーバー

Kafka メトリクスレシーバー 🔗

Kafkaメトリクスレシーバーは、KafkaサーバーからKafkaメトリクス(ブローカー、トピック、パーティション、コンシューマーグループなど)を収集し、OTLP形式に変換します。サポートされるパイプラインタイプは metrics です。詳細は パイプラインでデータを処理する を参照してください。

注釈

すぐに使えるダッシュボードとナビゲーターはまだKafkaメトリクスレシーバーではサポートされていませんが、将来のリリースではサポートされる予定です。

はじめに 🔗

以下の手順に従って、コンポーネントの設定とアクティベーションを行ってください:

  1. Splunk Distribution of the OpenTelemetry Collector をホストまたはコンテナプラットフォームにデプロイします:

  2. 次のセクションで説明するようにレシーバーを設定します。

  3. 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_fileinsecurefalse に設定されている場合のみ使用します。CA証明書へのパス。クライアントでは、サーバー証明書を検証します。

      • cert_fileinsecurefalse に設定されている場合のみ使用します。TLSが必要な接続に使用するTLS認証へのパス。

      • key_fileinsecurefalse に設定されている場合のみ使用します。TLSが必要な接続に使用するTLSキーへのパス。

      • insecure。デフォルトでは false です。tls設定で、サーバーの証明書チェーンとホスト名、InsecureSkipVerify の検証を無効にします。

      • server_name_override。バーチャルホスティングをサポートするためにクライアントが要求したサーバー名を示します。

    • kerberos。以下のフィールドがあります:

      • service_name。Kerberosサービス名。

      • realm。Kerberosレルム。

      • use_keytabtrue の場合、パスワードの代わりに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メトリクスレシーバーの設定オプションを示します:

NameTypeDefaultDescription
collection_intervalint641m0s

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_delayint641s

InitialDelay sets the initial start delay for the scraper, any non positive value is assumed to be immediately.

timeoutint64

Timeout is an optional value used to set scraper's context deadline.

cluster_aliasstring

Alias name of the kafka cluster

brokersslice

The list of kafka brokers (default localhost:9092)

resolve_canonical_bootstrap_servers_onlyboolfalse

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_versionstring

ProtocolVersion Kafka protocol version

topic_matchstring^[^_].*$

TopicMatch topics to collect metrics on

group_matchstring.*

GroupMatch consumer groups to collect on

auth (see fields)struct

Authentication data

scrapersslice

Scrapers defines which metric data points to be captured from kafka

client_idstringotel-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

NameTypeDefaultDescription
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

NameTypeDefaultDescription
usernamestring
passwordstring

Fields of sasl

NameTypeDefaultDescription
usernamestring

Username to be used on authentication

passwordstring

Password to be used on authentication

mechanismstring

SASL Mechanism to be used, possible values are: (PLAIN, AWS_MSK_IAM, SCRAM-SHA-256 or SCRAM-SHA-512).

versionint

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

NameTypeDefaultDescription
regionstring

Region is the AWS region the MSK cluster is based in

broker_addrstring

BrokerAddr is the client is connecting to in order to perform the auth required

Fields of tls

NameTypeDefaultDescription
ca_filestring

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_pemstring

In memory PEM encoded cert. (optional)

include_system_ca_certs_poolboolfalse

If true, load system CA certificates pool in addition to the certificates configured in this struct.

cert_filestring

Path to the TLS cert to use for TLS required connections. (optional)

cert_pemstring

In memory PEM encoded TLS cert to use for TLS required connections. (optional)

key_filestring

Path to the TLS key to use for TLS required connections. (optional)

key_pemstring

In memory PEM encoded TLS key to use for TLS required connections. (optional)

min_versionstring

MinVersion sets the minimum TLS version that is acceptable. If not set, TLS 1.2 will be used. (optional)

max_versionstring

MaxVersion sets the maximum TLS version that is acceptable. If not set, refer to crypto/tls for defaults. (optional)

cipher_suitesslice

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_intervalint64

ReloadInterval specifies the duration after which the certificate will be reloaded If not set, it will never be reloaded (optional)

insecureboolfalse

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_verifyboolfalse

InsecureSkipVerify will enable TLS but not verify the certificate.

server_name_overridestring

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

NameTypeDefaultDescription
service_namestring
realmstring
use_keytabboolfalse
usernamestring
passwordstring
config_filestring
keytab_filestring
disable_fast_negotiationboolfalse

Fields of metrics

NameTypeDefaultDescription
kafka.broker.log_retention_periodstruct

MetricConfig provides common config for a particular metric.

kafka.brokersstruct

MetricConfig provides common config for a particular metric.

kafka.consumer_group.lagstruct

MetricConfig provides common config for a particular metric.

kafka.consumer_group.lag_sumstruct

MetricConfig provides common config for a particular metric.

kafka.consumer_group.membersstruct

MetricConfig provides common config for a particular metric.

kafka.consumer_group.offsetstruct

MetricConfig provides common config for a particular metric.

kafka.consumer_group.offset_sumstruct

MetricConfig provides common config for a particular metric.

kafka.partition.current_offsetstruct

MetricConfig provides common config for a particular metric.

kafka.partition.oldest_offsetstruct

MetricConfig provides common config for a particular metric.

kafka.partition.replicasstruct

MetricConfig provides common config for a particular metric.

kafka.partition.replicas_in_syncstruct

MetricConfig provides common config for a particular metric.

kafka.topic.log_retention_periodstruct

MetricConfig provides common config for a particular metric.

kafka.topic.log_retention_sizestruct

MetricConfig provides common config for a particular metric.

kafka.topic.min_insync_replicasstruct

MetricConfig provides common config for a particular metric.

kafka.topic.partitionsstruct

MetricConfig provides common config for a particular metric.

kafka.topic.replication_factorstruct

MetricConfig provides common config for a particular metric.

Fields of kafka.broker.log_retention_period

NameTypeDefaultDescription
enabledboolfalse

Fields of kafka.brokers

NameTypeDefaultDescription
enabledbooltrue

Fields of kafka.consumer_group.lag

NameTypeDefaultDescription
enabledbooltrue

Fields of kafka.consumer_group.lag_sum

NameTypeDefaultDescription
enabledbooltrue

Fields of kafka.consumer_group.members

NameTypeDefaultDescription
enabledbooltrue

Fields of kafka.consumer_group.offset

NameTypeDefaultDescription
enabledbooltrue

Fields of kafka.consumer_group.offset_sum

NameTypeDefaultDescription
enabledbooltrue

Fields of kafka.partition.current_offset

NameTypeDefaultDescription
enabledbooltrue

Fields of kafka.partition.oldest_offset

NameTypeDefaultDescription
enabledbooltrue

Fields of kafka.partition.replicas

NameTypeDefaultDescription
enabledbooltrue

Fields of kafka.partition.replicas_in_sync

NameTypeDefaultDescription
enabledbooltrue

Fields of kafka.topic.log_retention_period

NameTypeDefaultDescription
enabledboolfalse

Fields of kafka.topic.log_retention_size

NameTypeDefaultDescription
enabledboolfalse

Fields of kafka.topic.min_insync_replicas

NameTypeDefaultDescription
enabledboolfalse

Fields of kafka.topic.partitions

NameTypeDefaultDescription
enabledbooltrue

Fields of kafka.topic.replication_factor

NameTypeDefaultDescription
enabledboolfalse

Fields of resource_attributes

NameTypeDefaultDescription
kafka.cluster.aliasstruct

ResourceAttributeConfig provides common config for a particular resource attribute.

Fields of kafka.cluster.alias

NameTypeDefaultDescription
enabledboolfalse
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

NameTypeDefaultDescription
strictstring
regexpstring

Fields of metrics_exclude

NameTypeDefaultDescription
strictstring
regexpstring

メトリクス 🔗

以下のメトリクス、リソース属性、および属性が使用できます。

NameTypeUnit ActiveDescriptionAttributes
kafka.brokersSum{brokers}Yes

Number of brokers in the cluster.

kafka.broker.log_retention_periodGaugesNo

log retention time (s) of a broker.

kafka.topic.partitionsSum{partitions}Yes

Number of partitions in topic.

kafka.topic.replication_factorGaugeNo

replication factor of a topic.

kafka.topic.log_retention_periodGaugesNo

log retention period of a topic (s).

kafka.topic.log_retention_sizeGaugeByNo

log retention size of a topic in Bytes, The value (-1) indicates infinite size.

kafka.topic.min_insync_replicasGauge{replicas}No

minimum in-sync replicas of a topic.

kafka.partition.current_offsetGaugeYes

Current offset of partition of topic.

kafka.partition.oldest_offsetGaugeYes

Oldest offset of partition of topic

kafka.partition.replicasSum{replicas}Yes

Number of replicas for partition of topic

kafka.partition.replicas_in_syncSum{replicas}Yes

Number of synchronized replicas of partition

kafka.consumer_group.membersSum{members}Yes

Count of members in the consumer group

kafka.consumer_group.offsetGaugeYes

Current offset of the consumer group at partition of topic

kafka.consumer_group.offset_sumGaugeYes

Sum of consumer group offset across partitions of topic

kafka.consumer_group.lagGaugeYes

Current approximate lag of consumer group at partition of topic

kafka.consumer_group.lag_sumGaugeYes

Current approximate sum of consumer group lag across all partitions of topic

Resource Attributes

NameType Description
kafka.cluster.aliasstring

The alias name (string) of the cluster

Attributes

NameType Description Values
brokerstring

The ID of the kafka broker

topicstring

The ID (integer) of a topic

partitionint

The number (integer) of the partition

groupstring

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 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.

このページは 2025年02月11日 に最終更新されました。