collectdおよびOpenTelemetryを使ってホストを監視する

collectd およびネイティブの OpenTelemetry を使用して、Splunk Observability Cloud のサービスを監視します。メリット、インストール、設定、メトリクスを参照してください

Splunk Observability CloudでネイティブのOpenTelemetryを使用してcollectdでインフラストラクチャを監視するには、このドキュメントの説明に従ってホストにcollectdデーモンをインストールし、Collectorインスタンスに接続します。

メリット

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

設定

以下の手順に従ってホストにcollectdデーモンをインストールし、OpenTelemetry Collectorに接続します:

  1. collectdをインストールして設定する

  2. OpenTelemetry Collector を設定する

  3. ビルドして実行する

1. collectdをインストールして設定する

以下の手順に従ってcollectdデーモンをインストールし、設定します:

  1. collectdをDebianパッケージまたはYumパッケージとしてホストにインストールする

  2. collectd/metrics.conf

  3. collectd/http.conf

この例では、ホストはUbuntu 24.04のDockerイメージで表されます。

DEFAULT
services:
   collectd:
      build: collectd
      container_name: collectd
      depends_on:
         - otelcollector
      volumes:
         - ./collectd/http.conf:/etc/collectd/collectd.conf.d/http.conf
         - ./collectd/metrics.conf:/etc/collectd/collectd.conf.d/metrics.conf

# OpenTelemetry Collector
otelcollector:
   image:  quay.io/signalfx/splunk-otel-collector:latest
   container_name: otelcollector
   command: ["--config=/etc/otel-collector-config.yml", "--set=service.telemetry.logs.level=debug"]
   volumes:
      - ./otel-collector-config.yml:/etc/otel-collector-config.yml

httpとメトリクスの設定ファイルは次のようになります:

YAML
# http.conf
# The minimal configuration required to have collectd send data to an OpenTelemetry Collector
# with a collectdreceiver deployed on port 8081.

LoadPlugin write_http
<Plugin "write_http">
   <Node "collector">
      URL "http://otelcollector:8081"
      Format JSON
      VerifyPeer false
      VerifyHost false
   </Node>
</Plugin>
YAML
# metrics.conf
# An example of collectd plugin configuration reporting free disk space on the host.

<LoadPlugin df>
   Interval 3600
</LoadPlugin>
<Plugin df>
   ValuesPercentage true
</Plugin>

2. OpenTelemetry Collector を設定する

CollectD レシーバーを使用して、HTTP 経由で collectd デーモンからのトラフィックをリッスンするように Collector インスタンスを設定します。

YAML
receivers:
   collectd:
      endpoint: "0.0.0.0:8081"

exporters:
   debug:
      verbosity: detailed

service:
   pipelines:
      metrics:
         receivers: [collectd]
         exporters: [debug]
注意: 必ず0.0.0.0を使用してDockerネットワークインターフェイス経由でポート8081をエクスポーズし、両方のDockerコンテナが相互に作用できるようにしてください。

3. ビルドして実行する

手順にしたがってサンプルを実行し、docker-composeのセットアップを開始し、collectdコンテナをビルドします:

BASH
$> docker compose up --build

Collectorがメトリクスを受信し、デバッグエクスポーターを介してそれらをstdoutに記録していることを確認します:

BASH
$> docker logs otelcollector

典型的な出力は次の通りです:

DEFAULT
StartTimestamp: 1970-01-01 00:00:00 +0000 UTC
Timestamp: 2024-12-20 19:55:44.006000128 +0000 UTC
Value: 38.976566
Metric #17
Descriptor:
   -> Name: percent_bytes.reserved
   -> Description:
   -> Unit:
   -> DataType: Gauge
NumberDataPoints #0
Data point attributes:
   -> plugin: Str(df)
   -> plugin_instance: Str(etc-hosts)
   -> host: Str(ea1d62c7a229)
   ->  dsname: Str(value)
StartTimestamp: 1970-01-01 00:00:00 +0000 UTC
Timestamp: 2024-12-20 19:55:44.006000128 +0000 UTC
Value: 5.102245
   {"kind": "exporter", "data_type": "metrics", "name": "debug"}

トラブルシューティング

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

_________ __ ______ _____________ _____ _________

_________ __ ___________ _________ ___ ____ _____ _____

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

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