Docs » Splunk Distribution of the OpenTelemetry Collector の利用開始 » Discover telemetry sources automatically » Automatic discovery and configuration for Kubernetes » Advanced customization for automatic discovery in Kubernetes

Advanced customization for automatic discovery in Kubernetes 🔗

Learn how to customize Splunk automatic discovery and configuration for advanced scenarios.

高度なカスタマイズにより、以下のタスクを達成することができます:

注釈

For advanced customization options in Linux, see Advanced customization for automatic discovery in Linux.

Change instrumentation version 🔗

デフォルトでは、Splunk Distribution of OpenTelemetry Collector は、関連するインストルメンテーションライブラリの最新バージョンを使用します。インストルメンテーションライブラリのバージョンを変更するには、以下の手順に従ってください:

  1. values.yaml ファイルを開きます。

  2. インストルメンテーション言語セクションで、tag の値を希望のバージョンに合わせて変更します。以下の例では、Javaインストルメンテーションバージョンを v1.27.0 に変更しています。

    clusterName: myCluster
    splunkObservability:
      realm: <splunk-realm>
      accessToken: <splunk-access-token>
    environment: prd
    certmanager:
      enabled: true
    operator:
      enabled: true
      instrumentation:
        spec:
          java:
            repository: ghcr.io/signalfx/splunk-otel-java/splunk-otel-java
            tag: v1.27.0
    
  3. 以下のコマンドで Splunk OTel Collector Chart を再インストールします。<CURRENT_VERSION> を現在の splunk-otel-collector-chart のバージョンに置き換えてください。

    helm upgrade splunk-otel-collector splunk-otel-collector-chart/splunk-otel-collector --version <CURRENT_VERSION> -f values.yaml
    

注釈

values.yaml ファイルに java フィールドがない場合は、バージョンを変更する前に、フィールドと repository 値を追加する必要があります。リポジトリの値は常に ghcr.io/signalfx/splunk-otel-java/splunk-otel-java です。

各言語の旧バージョンの詳細については、以下のページをご覧ください:

Override default instrumentation settings 🔗

You can override default automatic discovery settings to use features such as AlwaysOn profiling and runtime metrics.

Configure AlwaysOn Profiling 🔗

Kubernetes で AlwaysOn プロファイリングを設定するには、Helm チャートの values.yaml ファイルを編集します。

言語のプロファイリングを有効にするには、以下の手順に従ってください:

  1. values.yaml ファイルを開きます。

  2. In the operator.instrumentation.spec.<language>.env section, add the SPLUNK_PROFILER_ENABLED="true", SPLUNK_PROFILER_MEMORY_ENABLED="true", and SPLUNK_PROFILER_CALL_STACK_INTERVAL environment variables. For example, the following values.yaml file configures AlwaysOn Profiling to sample call stacks from a 5000 millisecond interval:

    operator:
      enabled: true
      instrumentation:
        spec:
          nodejs:
            env:
            # Activates AlwaysOn Profiling for Node.js
            - name: SPLUNK_PROFILER_ENABLED
              value: "true"
            - name: SPLUNK_PROFILER_MEMORY_ENABLED
              value: "true"
            # Samples call stacks from a 5000 millisecond interval.
            # If excluded, samples from a 10000 millisecond interval by default.
            - name: SPLUNK_PROFILER_CALL_STACK_INTERVAL
              value: 5000
    
  3. 以下のコマンドで Splunk OTel Collector Chart を再インストールします。<CURRENT_VERSION> を現在の splunk-otel-collector-chart のバージョンに置き換えてください。

    helm upgrade splunk-otel-collector splunk-otel-collector-chart/splunk-otel-collector --version <CURRENT_VERSION> -f values.yaml
    

Activate runtime metrics collection (Java and Node.js only) 🔗

You can activate runtime metrics collection for Java and Node.js applications running in your Kubernetes environment. To learn more about runtime metrics collection, see :

Follow these steps to activate runtime metrics collection:

  1. values.yaml ファイルを開きます。

  2. In the operator.instrumentation.spec.<language>.env section, add the SPLUNK_METRICS_ENABLED=true environment variable. For example, the following values.yaml file activates runtime metrics collection for Java applications:

    operator:
      enabled: true
      instrumentation:
        spec:
          java:
            env:
            # Activates runtime metrics collection for Java
            - name: SPLUNK_METRICS_ENABLED
              value: "true"
    
  3. In the operator.instrumentation.spec.env section, add the following environment variables and values to configure the endpoint to which the Collector sends runtime metrics:

    operator:
      enabled: true
      instrumentation:
        spec:
          env:
          - name: SPLUNK_OTEL_AGENT
            valueFrom:
              fieldRef:
                apiVersion: v1
                fieldPath: status.hostIP
          - name: SPLUNK_METRICS_ENDPOINT
            value: http://(SPLUNK_OTEL_AGENT):9943/v2/datapoint
    
  4. 以下のコマンドで Splunk OTel Collector Chart を再インストールします。<CURRENT_VERSION> を現在の splunk-otel-collector-chart のバージョンに置き換えてください。

    helm upgrade splunk-otel-collector splunk-otel-collector-chart/splunk-otel-collector --version <CURRENT_VERSION> -f values.yaml
    

Use automatic discovery with gateway mode 🔗

Splunk OTel Collector Chart はデフォルトでエージェントモードを使用します。ゲートウェイモードを有効にすると、OpenTelemetry Collector のインスタンスが別のコンテナに配置され、このインスタンスがクラスター全体からデータを収集します。

ゲートウェイモードについて詳細については、データ転送(ゲートウェイ)モード を参照してください。

ゲートウェイのエンドポイントにデータを送信するには、以下の手順に従ってください:

  1. values.yaml ファイルを開きます。

  2. operator.instrumentation.spec.exporter.endpoint の値をゲートウェイのエンドポイントに設定します。例:

    clusterName: myCluster
    splunkObservability:
      realm: <splunk-realm>
      accessToken: <splunk-access-token>
    environment: prd
    certmanager:
      enabled: true
    operator:
        enabled: true
        instrumentation:
          spec:
            exporter:
              endpoint: <gateway-endpoint>
    
  3. 以下のコマンドで Splunk OTel Collector Chart を再インストールします。<CURRENT_VERSION> を現在の splunk-otel-collector-chart のバージョンに置き換えてください。

    helm upgrade splunk-otel-collector splunk-otel-collector-chart/splunk-otel-collector --version <CURRENT_VERSION> -f values.yaml
    

values.yaml ファイルで agent.enabled: falsegateway.enabled: true を設定することで、デプロイされたゲートウェイのエンドポイントに自動的にデータを送信することもできます。例:

clusterName: myCluster
splunkObservability:
  realm: <splunk-realm>
  accessToken: <splunk-access-token>
environment: prd
certmanager:
  enabled: true
operator:
  enabled: true

agent:
  enabled: false
gateway:
  enabled: true

Using this configuration, automatic discovery automatically sends data to a running gateway endpoint.

追加設定 🔗

There are many other settings you can customize in automatic discovery and configuration.

各言語で変更できる設定のリストについては、以下のリソースを参照してください:

言語

リソース

Java

Splunk Observability Cloud 用の Java エージェントを設定する

Node.js

Splunk Observability Cloud 用の Splunk Distribution of OTel JS を設定する

Kubernetes の values.yaml で変更できる設定の完全なリストについては、https://github.com/signalfx/splunk-otel-collector-chart/blob/main/helm-charts/splunk-otel-collector/values.yaml を参照してください。

This page was last updated on 2024年05月13日.