Kubernetesプロキシ

Kubernetes プロキシモニターには、この Splunk Observability Cloud インテグレーションを 使用してください。メリット、インストール、設定、メトリクスを参照してください

Splunk Distribution of OpenTelemetry Collectorは、Smart Agentレシーバーと kubernetes-proxy モニタータイプを使用して、kube-proxyメトリクスからPrometheusメトリクスをPrometheus形式でエクスポートします。

パスが設定されていない場合、インテグレーションはデフォルトでパス /metrics をクエリし、「Prometheus エクスポータ」の説明に従って Prometheus メトリクスタイプを Splunk Observability Cloud メトリクスタイプに変換します。

このモニタータイプは、Kubernetes、Linux、Windowsで利用できます。

メリット

インテグレーションを設定すると、これらの機能にアクセスできるようになります:

インストール

このインテグレーションを導入するには、以下の手順に従ってください:

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

  2. [設定] セクションの説明に従ってインテグレーションを設定します。

  3. Splunk Distribution of OpenTelemetry Collector を再起動します。

設定

Smart Agent モニターとCollector のインテグレーションを使用するには、以下の手順に従います:

  1. Smart Agent レシーバーを設定ファイルに含めます。

  2. レシーバーセクションおよびパイプラインセクションの両方で、Collector 構成にモニタータイプを追加します。

このインテグレーションを有効にするには、Collector構成に以下を追加します:

receivers:
  smartagent/kubernetes-proxy
    type: kubernetes-proxy
    ... # Additional config

次に、設定ファイルの service.pipelines.metrics.receivers セクションにモニターを追加します:

service:
   pipelines:
     metrics:
       receivers: [smartagent/kubernetes-proxy]

例Kubernetesオブザーバー

以下はYAMLコンフィギュレーションの例です:

receivers:
  smartagent/kubernetes-proxy:
    type: kubernetes-proxy
    host: localhost
    port: 10249
    extraDimensions:
      metric_source: kubernetes-proxy

OpenTelemetry Collector には、Kubernetes オブザーバー(k8sobserver)があり、Kubernetes ポッドなどのネットワーク化されたエンドポイントを検出するための拡張機能として実装できます。このオブザーバーを使用する場合、OpenTelemetry Collector がホストモニタリング(エージェント)モードで展開され、個々のノードまたはホストインスタンスで実行されていることを前提としています。

オブザーバーを使用するには、関連するルールを持つレシーバクリエータのインスタンスを作成する必要があります。例:

extensions:
  # Configures the Kubernetes observer to watch for pod start and stop events.
  k8s_observer:
  host_observer:

receivers:
  receiver_creator/1:
    # Name of the extensions to watch for endpoints to start and stop.
    watch_observers: [k8s_observer]
    receivers:
      smartagent/kubernetes-kubeproxy:
        rule: type == "pod" && name matches "kube-proxy"
        type: kubernetes-proxy
        port: 10249
        extraDimensions:
          metric_source: kubernetes-proxy

      prometheus_simple:
        # Configure prometheus scraping if standard prometheus annotations are set on the pod.
        rule: type == "pod" && annotations["prometheus.io/scrape"] == "true"
        config:
          metrics_path: '`"prometheus.io/path" in annotations ? annotations["prometheus.io/path"] : "/metrics"`'
          endpoint: '`endpoint`:`"prometheus.io/port" in annotations ? annotations["prometheus.io/port"] : 9090`'

      redis/1:
        # If this rule matches an instance of this receiver will be started.
        rule: type == "port" && port == 6379
        config:
          # Static receiver-specific config.
          password: secret
          # Dynamic configuration value.
          collection_interval: `pod.annotations["collection_interval"]`
      resource_attributes:
          # Dynamic configuration value.
          service.name: `pod.labels["service_name"]`

      redis/2:
        # Set a resource attribute based on endpoint value.
        rule: type == "port" && port == 6379
        resource_attributes:
          # Dynamic value.
          app: `pod.labels["app"]`
          # Static value.
          source: redis

  receiver_creator/2:
    # Name of the extensions to watch for endpoints to start and stop.
    watch_observers: [host_observer]
    receivers:
      redis/on_host:
        # If this rule matches, an instance of this receiver is started.
        rule: type == "port" && port == 6379 && is_ipv6 == true
        resource_attributes:
          service.name: redis_on_host

processors:
  exampleprocessor:

exporters:
  exampleexporter:

service:
  pipelines:
    metrics:
      receivers: [receiver_creator/1, receiver_creator/2]
      processors: [exampleprocessor]
      exporters: [exampleexporter]
  extensions: [k8s_observer, host_observer]

詳しくは「Receiver creator」 を参照してください。

コンフィギュレーション設定

設定オプション

必須

タイプ

説明

httpTimeout

いいえ

int64

読み取りと書き込みの両方の操作に対する HTTP タイムアウト時間。これは、

https://golang.org/pkg/time/#ParseDuration」が受け付ける期間文字列です。デフォルト10s です。

username

いいえ

string

各リクエストで使用される Basic Auth ユーザー名 (ある場合)。

password

いいえ

string

各リクエストで使用するBasic Authパスワード (ある場合)。

useHTTPS

いいえ

bool

trueの場合、エージェントはHTTPSを使用してサーバに接続します

プレーン HTTP の代わりに HTTPS を使用します。デフォルトは false です。

httpHeaders

いいえ

map of strings

HTTP ヘッダー名と値のマップ。 同じメッセージヘッダーの

カンマ区切りの複数の値もサポートしています。

skipVerify

いいえ

bool

useHTTPSがtrueで、このオプションもtrueの場合、エクスポータ

TLS 証明書は検証されません。デフォルトは false です。

sniServerName

いいえ

string

useHTTPSがtrueでskipVerifyがtrueの場合、sniServerNameは

返された証明書でホスト名を検証するために使用されます。また、IP アドレスでない限り、バーチャルホスティングをサポートするために、クライアントのハンドシェイクにも含まれます。

caCertPath

いいえ

string

TLS証明書に署名したCA証明書へのパス。

skipVerify がfalseに設定されています。

clientCertPath

いいえ

string

TLSが必要な接続に使用するクライアントTLS証明書へのパス。

clientKeyPath

いいえ

string

TLSが必要な接続に使用するクライアントTLSキーへのパス。

host

はい

string

エクスポーターのホスト。

port

はい

integer

エクスポーターのポート。

useServiceAccount

いいえ

bool

認証にポッドサービスアカウントを使用します。デフォルトは

falseします。

metricPath

いいえ

string

エクスポータサーバー上のメトリクスエンドポイントへのパス。デフォルト

/metrics です。

sendAllMetrics

いいえ

bool

Prometheusエクスポーターから出力されるすべてのメトリクスを

フィルタリングせずに送信します。このオプションは、Prometheus エクスポータモニターを直接使用する場合には、組み込みのフィルタリングがないため効果がなく、他のモニターに埋め込む場合にのみ効果があります。デフォルトは false です。

メトリクス

このインテグレーションでは、以下のメトリクスを使用できます:

https://raw.githubusercontent.com/signalfx/splunk-otel-collector/main/internal/signalfx-agent/pkg/monitors/kubernetes/proxy/metadata.yaml

備考

  • Splunk Observability Cloud で利用可能なメトリクスタイプの詳細は、「メトリクスタイプ」を参照してください。

  • ホストベースのサブスクリプションプランでは、デフォルトのメトリクスは、ホスト、コンテナ、バンドルメトリクスなど、Splunk Observability Cloud のホストベースのサブスクリプションに含まれるメトリクスです。カスタムメトリクスはデフォルトでは提供されていないため、料金が発生する場合があります。詳細については、「メトリクスカテゴリ」を参照してください。

  • MTSベースのサブスクリプションプランでは、すべてのメトリクスがカスタムです。

  • メトリクスを追加するには、「その他のメトリクスの追加」で extraMetrics の設定方法を参照してください。

デフォルト以外のメトリクス(バージョン 4.7.0 以降)

デフォルトではないメトリクスを出力するには、汎用モニターレベルの extraMetrics 設定オプションでそれらのメトリクスを追加します。上記のメトリクスのリストに表示されない特定の設定オプションから派生したメトリクスは、 extraMetrics に追加する必要はありません。

実行中のエージェントインスタンスでこのモニターを設定した後、agent-status monitors を実行すると、発行されるメトリクスのリストを見ることができます。

トラブルシューティング

__ ___ ___ _ ______ _____________ _____ ________ ___ ___ ___ ____ __ ___ ____ ____ __ ______ _____________ ______ ___ ___ ___ ____ __ ___ _________ _____

_________ __ ______ _____________ _____ _________

_________ __ ___________ _________ ___ ____ _____ _____

  • ___ _ ________ ___ ___ _______ _______ _________ _______ __ ______ ________

  • ____ ___ ______ ______________ ____ _____ _____ _______ __ ___________ ____ __________ _________ ___ ______ _________ __________ __ _____ ___ ____ _______