Docs » その他のデータ取り込み方法 » OpenTelemetry Collector Contribプロジェクトを使用してテレメトリを送信します。

注意

Splunk は OpenTelemetry Collector Contrib に対してベストエフォートサポートを提供します。Splunk OpenTelemetry ディストリビューションのみが、Splunk の公式サポートおよびサポート関連のサービスレベル契約 (SLA) の対象となります。

OpenTelemetry Collector Contribプロジェクトを使用してテレメトリを送信します。 🔗

OpenTelemetry Collector Contrib プロジェクトは、正式には アップストリーム Collector と呼ばれ、Splunk Distribution of OpenTelemetry Collector を含む、すべての OpenTelemetry Collector ディストリビューションのアップストリームソースです。アップストリーム Collector には、Splunk Observability Cloud を含むいくつかの観測可能性バックエンド用のレシーバーやエクスポーターなど、ベンダー固有のコンポーネントが含まれています。

一方、Splunk Distribution of OpenTelemetry Collector は、Splunk Observability Cloud 用に構成されており、さまざまな構成管理ツールまたはインストーラ・スクリプトを使用して自動的にデプロイできます。このディストリビューションは、OpenTelemetry Collector Contrib プロジェクトからのすべての機能を保持しながら、Collector に追加機能を追加します。Splunk Distribution of the OpenTelemetry Collector の利用開始 を参照してください。

技術的または実用的な理由でアップストリームコレクタを使用する必要がある場合でも、Splunk Observability Cloud にトレースとメトリクスを送信できます。アップストリームコレクタと Splunk OTel コレクタの違い、アップストリームコレクタを Splunk Observability Cloud 用に設定する方法、アップストリームコレクタから Splunk Distribution of OpenTelemetry Collector に移行する方法については、続きをお読みください。

注釈

Splunk は OpenTelemetry プロジェクトに参加し、その成長にコミットしています。Splunk ディストリビューション用に開発された機能は、コミュニティ全体の利益のために定期的にアップストリームの Collector に追加されます。最終的にはすべての Splunk ディストリビューションが OpenTelemetry Contrib Collector プロジェクトのスナップショットになることが目標です。

機能の比較 🔗

以下の表は、Splunk Distribution of OpenTelemetry Collector と OpenTelemetry Collector Contrib プロジェクトの Collector を比較したものです。

機能

Splunk Distribution of OpenTelemetry Collector

OpenTelemetry Collector Contrib プロジェクト

Splunk サポート

フルサポート

ベストエフォート

LinuxおよびWindows用インストーラ・スクリプト

はい、Windows と Linux 用です

いいえ

Splunk Observability Cloud 用に設定されています

はい、ホストモニタリング(エージェント)モードとデータ転送(ゲートウェイ)モード用です

いいえ

Automatic discovery and configuration

はい

いいえ

設定管理ツールのレシピ

はい、Ansible、Chef、Puppet、Salt用です

いいえ

IMM用レシーバーは付属しています

はい

いいえ

AlwaysOn Profiling

はい、CPUとメモリです

いいえ

関連コンテンツ

はい

はい(Splunk エクスポーター使用時)

前提条件 🔗

Splunk Observability Cloud にデータを送信するには、OpenTelemetry Collector Contrib プロジェクトの Collector を使用できます。詳細は GitHub の https://github.com/open-telemetry/opentelemetry-collector-contrib を参照してください。

注釈

Collector を設定する前に、OpenTelemetry Collector Contrib のバージョン番号が最新の Splunk ディストリビューションと同じであることを確認してください。Splunk Distribution of OpenTelemetry Collector のバージョンを確認するには、GitHub の Releases ページを参照してください。

Splunk Observability Cloud のサンプル設定 🔗

次の例では、Splunk Observability Cloud にメトリクスとトレースを送信するようにアップストリーム Collector を設定する方法を示します:

# Minimum configuration file for the OpenTelemetry Collector Contrib distribution
# https://github.com/open-telemetry/opentelemetry-collector-contrib
#
# For official documentation, see the following page:
# https://docs.splunk.com/Observability/gdi/other-ingestion-methods/upstream-collector.html

# The following environment variables are required to be manually defined or
# configured below:
# - SPLUNK_ACCESS_TOKEN: The Splunk access token to authenticate requests
# - SPLUNK_API_URL: The Splunk API URL, e.g. https://api.us0.signalfx.com
# - SPLUNK_BALLAST_SIZE_MIB: This size of the ballast which should be 1/3 to 1/2 of memory allocated
# - SPLUNK_MEMORY_LIMIT_MIB: 90% of memory allocated
# - SPLUNK_HEC_TOKEN: The Splunk HEC authentication token
# - SPLUNK_HEC_URL: The Splunk HEC endpoint URL, e.g. https://ingest.us0.signalfx.com/v1/log
# - SPLUNK_INGEST_URL: The Splunk ingest URL, e.g. https://ingest.us0.signalfx.com
# - SPLUNK_TRACE_URL: The Splunk trace endpoint URL, e.g. https://ingest.us0.signalfx.com/v2/trace

extensions:
  health_check:
    endpoint: 0.0.0.0:13133
  http_forwarder:
    ingress:
      endpoint: 0.0.0.0:6060
    egress:
      endpoint: "${SPLUNK_API_URL}"
      # Use instead when sending to gateway
      #endpoint: "${SPLUNK_GATEWAY_URL}"
  zpages:
    #endpoint: 0.0.0.0:55679

receivers:
  fluentforward:
    endpoint: 127.0.0.1:8006
  hostmetrics:
    collection_interval: 10s
    scrapers:
      cpu:
      disk:
      filesystem:
      memory:
      network:
      # System load average metrics https://en.wikipedia.org/wiki/Load_(computing)
      load:
      # Paging/Swap space utilization and I/O metrics
      paging:
      # Aggregated system process count metrics
      processes:
      # System processes metrics, disabled by default
      # process:
  jaeger:
    protocols:
      grpc:
        endpoint: 0.0.0.0:14250
      thrift_binary:
        endpoint: 0.0.0.0:6832
      thrift_compact:
        endpoint: 0.0.0.0:6831
      thrift_http:
        endpoint: 0.0.0.0:14268
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317
      http:
        endpoint: 0.0.0.0:4318
  # This section is used to collect the OpenTelemetry Collector metrics
  # Even if just a Splunk APM customer, these metrics are included
  prometheus/internal:
    config:
      scrape_configs:
      - job_name: 'otel-collector'
        scrape_interval: 10s
        static_configs:
        - targets: ['0.0.0.0:8888']
        metric_relabel_configs:
          - source_labels: [ __name__ ]
            regex: 'otelcol_rpc_.*'
            action: drop
          - source_labels: [ __name__ ]
            regex: 'otelcol_http_.*'
            action: drop
          - source_labels: [ __name__ ]
            regex: 'otelcol_processor_batch_.*'
            action: drop
  signalfx:
    endpoint: 0.0.0.0:9943
  zipkin:
    endpoint: 0.0.0.0:9411

processors:
  batch:
  # Enabling the memory_limiter is strongly recommended for every pipeline.
  # Configuration is based on the amount of memory allocated to the collector.
  # In general, the limit should be 90% of the collector's memory. The simplest way to specify the
  # ballast size is set the value of SPLUNK_BALLAST_SIZE_MIB env variable.
  # For more information about memory limiter, see
  # https://github.com/open-telemetry/opentelemetry-collector/blob/main/processor/memorylimiter/README.md
  memory_limiter:
    check_interval: 2s
    limit_mib: ${SPLUNK_MEMORY_LIMIT_MIB}

  # Detect if the collector is running on a cloud system, which is important for creating unique cloud provider dimensions.
  # Detector order is important: the `system` detector goes last so it can't preclude cloud detectors from setting host/os info.
  # Resource detection processor is configured to override all host and cloud attributes because instrumentation
  # libraries can send wrong values from container environments.
  # https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/resourcedetectionprocessor#ordering
  resourcedetection:
    detectors: [gcp, ecs, ec2, azure, system]
    override: true

  # Optional: The following processor can be used to add a default "deployment.environment" attribute to the logs and
  # traces when it's not populated by instrumentation libraries.
  # If enabled, make sure to enable this processor in the pipeline below.
  #resource/add_environment:
    #attributes:
      #- action: insert
        #value: staging/production/...
        #key: deployment.environment

exporters:
  # Traces
  sapm:
    access_token: "${SPLUNK_ACCESS_TOKEN}"
    endpoint: "${SPLUNK_TRACE_URL}"
  # Metrics + Events
  signalfx:
    access_token: "${SPLUNK_ACCESS_TOKEN}"
    api_url: "${SPLUNK_API_URL}"
    ingest_url: "${SPLUNK_INGEST_URL}"
    # Use instead when sending to gateway
    #api_url: http://${SPLUNK_GATEWAY_URL}:6060
    #ingest_url: http://${SPLUNK_GATEWAY_URL}:9943
    sync_host_metadata: true
    correlation:
  # Logs for Splunk Cloud Platform and Log Observer Connect
  # See https://docs.splunk.com/Observability/gdi/opentelemetry/components/splunk-hec-exporter.html
  splunk_hec:
    token: "${SPLUNK_HEC_TOKEN}"
    endpoint: "${SPLUNK_HEC_URL}"
    source: "otel"
    sourcetype: "otel"
    profiling_data_enabled: false
  splunk_hec/profiling:
    token: "${SPLUNK_ACCESS_TOKEN}"
    endpoint: "https://ingest.${SPLUNK_REALM}.signalfx.com/v1/log"
    log_data_enabled: false
  # Send to gateway
  otlp:
    endpoint: "${SPLUNK_GATEWAY_URL}:4317"
    tls:
      insecure: true
  # Debug
  debug:
    verbosity: detailed

service:
  extensions: [health_check, http_forwarder, zpages]
  pipelines:
    # Required for Splunk APM
    traces:
      receivers: [jaeger, otlp, zipkin]
      processors:
      - memory_limiter
      - batch
      - resourcedetection
      #- resource/add_environment
      exporters: [sapm, signalfx]
      # Use instead when sending to gateway
      #exporters: [otlp, signalfx]
    # Required for Splunk Infrastructure Monitoring
    metrics:
      receivers: [hostmetrics, otlp, signalfx]
      processors: [memory_limiter, batch, resourcedetection]
      exporters: [signalfx]
      # Use instead when sending to gateway
      #exporters: [otlp]
    # Required for Splunk APM and/or Infrastructure Monitoring
    metrics/internal:
      receivers: [prometheus/internal]
      processors: [memory_limiter, batch, resourcedetection]
      exporters: [signalfx]
      # Use instead when sending to gateway
      #exporters: [otlp]
    # Required for Splunk Infrastructure Monitoring
    logs/signalfx:
      receivers: [signalfx]
      processors: [memory_limiter, batch]
      exporters: [signalfx]
      # Use instead when sending to gateway
      #exporters: [otlp]
    # Required for profiling
    logs:
      receivers: [otlp]
      processors:
      - memory_limiter
      - batch
      - resourcedetection
      #- resource/add_environment
      exporters: [splunk_hec/profiling]
      # Use instead when sending to gateway
      #exporters: [otlp]

Splunk Distribution of OpenTelemetry Collector への移行 🔗

既存のアップストリーム Collector から Splunk Distribution of OpenTelemetry Collectorへの移行は、Splunk ディストリビューションが OpenTelemetry Collector をベースにしているため、他のプロプライエタリなエージェントからの移行よりも少ないステップで済みます。

Collector Contribor から Splunk OTel Collector に移行するには、以下の手順に従います:

  1. 現在のアップストリーム Collector 構成のコピーを保存します。

  2. Linux の sudo systemctl stop otelcol または Windows の net stop otelcol を使用して、Collector Contrib サービスを停止します。ターミナルセッションで Collector Contrib を実行している場合は、Ctrl+C を選択して中断します。

  3. システムサービス設定ファイルを含む、OpenTelemetry Collector Contrib のバイナリと設定ファイルを削除するか、システムのパッケージ・マネージャーを使用してアップストリームの Collector を削除します。

  4. Splunk OTel Collector をインストールします。はじめに:Collectorを理解して使用する を参照してください。Kubernetes に Collector をデプロイした場合は、Helm チャートを使用します。詳細は Install the Collector for Kubernetes using Helm を参照してください。

  5. Collector Contrib プロジェクトを削除する前に保存した設定と、Splunk Distribution of OpenTelemetry Collector で利用可能なコンポーネントを考慮して Splunk OTel Collector を設定します。Splunk Observability Cloud のサンプル設定 および Collector コンポーネント を参照してください。

トラブルシューティング 🔗

Splunk Observability Cloudをご利用のお客様で、Splunk Observability Cloudでデータを確認できない場合は、以下の方法でサポートを受けることができます。

Splunk Observability Cloudをご利用のお客様

見込み客および無料トライアルユーザー様

  • Splunk Answers のコミュニティサポートで質問し、回答を得る

  • Splunk #observability ユーザーグループの Slack チャンネルに参加して、世界中の顧客、パートナー、Splunk 社員とのコミュニケーションを図る。参加するには、Get Started with Splunk Community マニュアルの チャットグループ を参照してください。

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