ログエクスポーター

ロギングエクスポータを使用して、トレース、メトリクス、ログをコンソールに書き込みます。コンポーネントの設定方法については、続きをお読みください。

注: ロギングエクスポータは 2024 年 9 月に廃止され、Debug exporter が採用される予定です。詳しくは「Debug exporter」で GitHub リポジトリとドキュメントを参照してください。

ロギングエクスポータにより、OpenTelemetry Collector はトレース、メトリクス、ログをコンソールに直接送信できます。サポートされるパイプラインタイプは、tracesmetricslogs です。詳細については「パイプラインでデータを処理する」を参照してください。

ロギング・エクスポーターを使用して、OpenTelemetry Collectorによって受信され処理されたテレメトリの問題を診断しトラブルシューティングしたり、他の目的のためにサンプルを取得したりします。

はじめに

注: ロギングエクスポータは、パイプラインのアクティビティをログとしてコンソールに送信します。OpenTelemetry Collector 自体の出力レベルを制御するには、service.logger 設定を使用します。

デフォルトでは、Splunk Distribution of OpenTelemetry Collector には、ホストモニタリング(エージェント)モードでデプロイする際に、出力レベルを detailed に設定したロギングエクスポータが含まれています。詳細については、「Collector deployment modes」を参照してください。

YAML
exporters:
   # ...
   # Other exporters
   # ...
   logging:
      # loglevel is deprecated; use verbosity instead
      # Available levels are "basic", "normal", and "detailed"
      verbosity: detailed

ロギングエクスポータを有効にするには、診断したいパイプラインに追加します。例:

YAML
:emphasize-lines: 9, 13, 20

service:
  pipelines:
    traces:
      receivers: [jaeger, otlp, zipkin]
      processors:
      - memory_limiter
      - batch
      - resourcedetection
      exporters: [otlphttp, signalfx, logging]
    metrics:
      receivers: [hostmetrics, otlp, signalfx]
      processors: [memory_limiter, batch, resourcedetection]
      exporters: [signalfx, logging]
    logs:
      receivers: [fluentforward, otlp]
      processors:
      - memory_limiter
      - batch
      - resourcedetection
      exporters: [splunk_hec, logging]

使用可能な出力レベルは basicnormaldetailed です。出力レベルとログレベルの対応は以下の通りです。

冗長性レベル

ログレベル (非推奨)

basic

warnerrorpanicfatal

normal

info

detailed

debug

注: detailed の出力レベルを指定すると、ホストのリソース消費量が増加する場合があります。十分なサンプルを取得したら、ロギングエクスポータを無効にします。

収集したログを確認する

ロギング・エクスポーターによって生成されたログを確認するには、以下のコマンドを実行します:

BASH
journalctl -u splunk-otel-collector.service -f

サンプル構成

次の例は、debug ログレベルと同等の詳細な出力レベルを備えたロギングエクスポータを示しています。最初のサンプリングでは 1 秒あたり 5 個のメッセージがログに記録され、最初のサンプリングの後は 200 メッセージごとにログに記録されます。

YAML
exporters:
  logging:
    verbosity: detailed
    sampling_initial: 5
    sampling_thereafter: 200

設定

次の表は、ロギング・エクスポーターの設定オプションを示したものです:

トラブルシューティング

If you are a Splunk Observability Cloud customer and are not able to see your data in Splunk Observability Cloud, you can get help in the following ways.

Available to Splunk Observability Cloud customers

Available to prospective customers and free trial users

  • Ask a question and get answers through community support at Splunk Answers.

  • Join the Splunk community #observability Slack channel to communicate with customers, partners, and Splunk employees worldwide.