エージェント
The content of this page may be outdated and some links may be invalid.
A newer version of this page exists in
English. To see the changes to the English page since this page was last updated: visit
GitHub compare
b34ebe22..d6579803
and search for
More information ...
content/en/docs/collector/deployment/agent.md
.
コレクターのエージェントデプロイメントパターンは、OpenTelemetry SDKを使用して計装されたアプリケーション(OpenTelemetryプロトコル(OTLP)を使用)や、他のコレクター(OTLPエクスポーターを使用)が、テレメトリーシグナルをコレクターインスタンスに送信する構成です。 このコレクターインスタンスは、アプリケーションと同じホストまたはアプリケーションの横に配置されたサイドカーやデーモンセットとして動作します。
各クライアント側SDKまたはダウンストリームコレクターは、コレクターの場所を設定します。
- アプリケーションで、SDKがOTLPデータをコレクターに送信するように設定されます。
- コレクターは、テレメトリーデータを1つ以上のバックエンドに送信するように設定されます。
例
コレクターのエージェントデプロイメントパターンの具体例は以下のようになります。
たとえば、Javaアプリケーションを計装してメトリクスをエクスポートするためにOpenTelemetry Java SDKを使用します。
アプリケーションのコンテキスト内で、OTEL_METRICS_EXPORTER
をotlp
(デフォルト値)に設定し、OTLPエクスポーターをコレクターのアドレスで設定します。たとえば、Bashまたはzsh
シェルでは、次のように設定します。
export OTEL_EXPORTER_OTLP_ENDPOINT=http://collector.example.com:4318
collector.example.com:4318
で動作するコレクターは次のように設定されます。
receivers:
otlp: # アプリケーションがトレースを送信するOTLPレシーバー
protocols:
http:
endpoint: 0.0.0.0:4318
processors:
batch:
exporters:
otlp/jaeger: # JaegerはOTLPを直接サポートしています
endpoint: https://jaeger.example.com:4317
service:
pipelines:
traces/dev:
receivers: [otlp]
processors: [batch]
exporters: [otlp/jaeger]
receivers:
otlp: # アプリケーションがメトリクスを送信するOTLPレシーバー
protocols:
http:
endpoint: 0.0.0.0:4318
processors:
batch:
exporters:
prometheusremotewrite: # PRWエクスポーター、メトリクスをバックエンドに取り込む
endpoint: https://prw.example.com/v1/api/remote_write
service:
pipelines:
metrics/prod:
receivers: [otlp]
processors: [batch]
exporters: [prometheusremotewrite]
receivers:
otlp: # アプリケーションがログを送信するOTLPレシーバー
protocols:
http:
endpoint: 0.0.0.0:4318
processors:
batch:
exporters:
file: # ファイルエクスポーター、ログをローカルファイルに取り込む
path: ./app42_example.log
rotation:
service:
pipelines:
logs/dev:
receivers: [otlp]
processors: [batch]
exporters: [file]
実際に試してみたい場合は、エンドツーエンドのJavaやPythonの例で確認できます。
トレードオフ
長所:
- 始めやすい
- アプリケーションとコレクターの間に明確な1:1のマッピング
短所:
- スケーラビリティ(人的および負荷面)
- 柔軟性に欠ける
フィードバック
このページは役に立ちましたか?
Thank you. Your feedback is appreciated!
Please let us know how we can improve this page. Your feedback is appreciated!