/etc/otelcol-contrib/config.yaml. It explains how receivers, processors, exporters, extensions, service pipelines, and the telemetry / debug exporter interact. You’ll also learn how to control Collector log verbosity via the telemetry section and how to adjust the debug exporter verbosity to inspect metric/log payloads.
To edit the config file:
Receivers
This Collector uses two receivers:filelog— tails a JSON file and emits log entries.prometheus— exposes/scrapes internal Collector metrics for pipelines.
| Receiver | Purpose | Typical use-case |
|---|---|---|
filelog | Tail file-based logs | Read application or device JSON logs (e.g., aircraft.json) |
prometheus | Expose/collect metrics | Scrape internal Collector metrics or application metrics |
Processors
Processors enrich, transform, or otherwise manipulate telemetry data before export. This configuration includes:resource_detection— auto-detect system/host attributes.attributes— upsert or transform log/metric attributes.cumulativetodelta— convert cumulative metrics to delta form (useful for backends expecting deltas).transform/fix_names— optional transform processor declared but not attached to pipelines by default.
transform/fix_names processor, add it to a pipeline’s processors list (e.g., processors: [resource_detection, transform/fix_names]).
Exporters
This configuration uses two OTLP exporters and thedebug exporter for local inspection.
- Replace
${DT_ENDPOINT}and${DT_API_TOKEN}with actual Dynatrace OTLP HTTP endpoint and API token. - Avoid
tls.insecure: truein production; configure proper TLS for OTLP exporters.
Extensions
Common extensions enable health checks, profiling, and zPages for debugging:Service and Pipelines
Theservice section wires receivers, processors, and exporters into pipelines. Important: the debug exporter must be listed in a pipeline for it to emit debug output for that signal.
Telemetry (Collector internal logs & metrics)
Thetelemetry section controls the Collector’s own logs and how internal metrics are exposed to readers (e.g., Prometheus). Setting telemetry.logs.level adjusts the verbosity of the Collector’s operational logs.
Example telemetry block with metrics reader:
- If
telemetry.logs.levelis not set, the Collector defaults toINFO. - The Prometheus reader above exposes internal metrics on the configured host/port so the Prometheus receiver (or other collectors) can scrape them.
Viewing Collector logs
Follow the Collector service logs with systemd/journalctl:telemetry.logs.level is not explicitly set, you’ll typically see info-level messages about receivers, exporters, and pipeline processing. If the debug exporter is included in a pipeline and telemetry.logs.level permits, you’ll also see debug exporter output in the logs.
Changing Collector telemetry log level
To reduce log noise temporarily, settelemetry.logs.level to "ERROR" and restart the Collector:
level: "ERROR", routine informational lines no longer appear in journalctl; only error-level telemetry is shown. Revert to "INFO" (or remove the setting) and restart to restore normal operational logs.
Debug exporter verbosity
Thedebug exporter prints telemetry payloads to the Collector logs and has three verbosity levels:
basic— minimal detailnormal— more detaildetailed— full metric data including histogram buckets and attributes
- Ensure
debugis declared underexporters. - Add
debugto the pipeline’sexporterslist for the signal you want to inspect. - Make sure
telemetry.logs.levelis at leastINFOso the debug exporter prints to logs.
Common runtime commands
| Task | Command |
|---|---|
| Edit config | sudo nano /etc/otelcol-contrib/config.yaml |
| Restart Collector | sudo systemctl restart otelcol-contrib |
| Follow logs | sudo journalctl -u otelcol-contrib -f |
Callouts
Ensure the
debug exporter is declared under exporters and also listed in the pipeline exporters for the signal you want to inspect. Also keep telemetry.logs.level at or above INFO so debug exporter output is visible in logs.Do not use
tls.insecure: true in production. Configure proper TLS for OTLP exporters and for any remote collectors to protect telemetry data.Summary
- Receivers collect logs and internal metrics (
filelog,prometheus). - Processors enrich and transform telemetry (
resource_detection,attributes,cumulativetodelta, optionaltransform). - Exporters send data to remote backends (
otlphttp/dynatrace,otlp/collector2) anddebugfor local inspection. telemetrycontrols the Collector’s own logs and internal metrics exposure; adjusttelemetry.logs.levelto control noise.- Use
debugexporter withverbosity: detailedto inspect full payloads; usebasicornormalto reduce output. - After changing config, restart the service and follow logs with
journalctl -u otelcol-contrib -f.
Links and References
- OpenTelemetry Collector documentation: https://opentelemetry.io/docs/collector/
- Prometheus scrape configs: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config
- Dynatrace OTLP ingestion (reference your Dynatrace docs for the exact endpoint and headers)
transform/fix_names processor into a pipeline or want a sample service block with more pipelines (traces, logs, metrics) let me know and I’ll add a fully annotated example.