The decentralized collector deployment pattern consists of applications—instrumented with an OpenTelemetry SDK using OpenTelemetry protocol (OTLP)—or other collectors (using the OTLP exporter) that send telemetry signals to one or more collectors. Each client-side SDK or downstream collector is configured with a collector location:
A concrete example of the decentralized collector deployment pattern could look
as follows: you manually instrument, say, a Java application to export
metrics using the OpenTelemetry Java SDK. In the
context of the app, you would set the OTEL_METRICS_EXPORTER
to otlp
(which
is the default value) and configure the OTLP exporter with the
address of your collector, for example (in Bash or zsh
shell):
export OTEL_EXPORTER_OTLP_ENDPOINT=http://collector.example.com:4318
The collector serving at collector.example.com:4318
would then be configured
like so:
receivers:
otlp: # the OTLP receiver the app is sending traces to
protocols:
grpc:
processors:
batch:
exporters:
jaeger: # the Jaeger exporter, to ingest traces to backend
endpoint: "https://jaeger.example.com:14250"
insecure: true
service:
pipelines:
traces/dev:
receivers: [otlp]
processors: [batch]
exporters: [jaeger]
receivers:
otlp: # the OTLP receiver the app is sending metrics to
protocols:
grpc:
processors:
batch:
exporters:
prometheusremotewrite: # the PRW exporter, to ingest metrics to backend
endpoint: "https://prw.example.com/v1/api/remote_write"
service:
pipelines:
metrics/prod:
receivers: [otlp]
processors: [batch]
exporters: [prometheusremotewrite]
receivers:
otlp: # the OTLP receiver the app is sending logs to
protocols:
grpc:
processors:
batch:
exporters:
file: # the File Exporter, to ingest logs to local file
path: "./app42_example.log"
rotation:
service:
pipelines:
logs/dev:
receivers: [otlp]
processors: [batch]
exporters: [file]
If you want to try it out for yourself, you can have a look at the end-to-end Java or Python examples.
Pros:
Cons: