Collect logs and metrics with the OpenTelemetry Collector (34)
Getting data into the collector is the first job of any pipeline, and the receiver block is where most configs go wrong: a path glob that matches nothing, a syslog port nobody listens on, a scrape job without a target.
Every config below is a complete file for one source, from Linux log files and journald to Windows event logs, Kubernetes, network devices, Prometheus endpoints and OTLP. Each one passes the collector's own validate command, and many show the record that comes out.
Tail a log file
Ship an application log file to your backend, and keep your place in it across collector restarts.
Logs
Get the config →Receive syslog (RFC 5424 and RFC 3164)
Accept modern and legacy syslog on one collector, from network gear and hosts that speak nothing else.
Logs
Get the config →Receive OTLP over gRPC and HTTP
The front door: accept OTLP from SDKs and other collectors, on both transports, for all three signals.
Logs · Metrics · Traces
Get the config →Parse JSON log lines into attributes
Turn each JSON log line into attributes you can filter and group by, keeping the original line as the body.
Logs
Get the config →Parse nginx access logs into semantic conventions
Turn nginx combined-format access log lines into OpenTelemetry semantic-convention attributes, with typed status codes.
Logs
Get the config →Parse Apache access logs into semantic conventions
Turn Apache combined-format access log lines into semantic-convention attributes, with typed status codes and sizes.
Logs
Get the config →Parse key=value log lines
Turn logfmt-style key=value lines into attributes, quoted values with spaces included.
Logs
Get the config →Use the timestamp in the log line, in the right time zone
Stamp each record with the time written in the line, not the time the collector read it - in the zone it was written in.
Logs
Get the config →Map your log levels to OpenTelemetry severity
Set severity_number from your level field, including names like warning, err and crit, so severity filters work.
Logs
Get the config →Collect host metrics (CPU, memory, disk, network, processes)
CPU, memory, disk, filesystem, network, load and per-process metrics from every host, without a separate node agent.
Metrics
Get the config →Read systemd journal logs (journald)
Ship systemd journal entries for the units you choose, at the priority you choose, instead of tailing files that do not exist.
Logs
Get the config →Scrape Prometheus metrics endpoints
Scrape any Prometheus /metrics endpoint - node_exporter, an application, an exporter - into OpenTelemetry metrics.
Metrics
Get the config →Receive StatsD metrics
Accept StatsD counters, gauges and timers from applications that already emit them, and send them on as OpenTelemetry metrics.
Metrics
Get the config →Receive logs from Fluent Bit and Fluentd (forward)
Take logs from existing Fluent Bit or Fluentd agents over the forward protocol, without replacing them first.
Logs
Get the config →Receive plain log lines over TCP
A raw TCP port for appliances and scripts that can only write lines to a socket.
Logs
Get the config →Receive log messages over UDP
A UDP port for senders that fire and forget log messages, one datagram per message.
Logs
Get the config →Check HTTP endpoints (synthetic availability)
Probe your HTTP endpoints from the collector and get status class, duration and error metrics per URL.
Metrics
Get the config →Check TCP ports (databases, caches)
Know when a database or cache port stops accepting connections, from the collector next to it.
Metrics
Get the config →Collect Kubernetes pod logs (DaemonSet)
Every container's logs from every node, with namespace, pod and container read from the log path - one DaemonSet, no sidecars.
Logs
Get the config →Collect node, pod and container metrics from the kubelet
CPU, memory, filesystem and network for every node, pod and container, read from the kubelet on each node.
Metrics
Get the config →Collect Kubernetes cluster metrics (one replica)
Deployment replicas, pod phases, node conditions, restarts and resource quotas from the Kubernetes API - one collector for the whole cluster.
Metrics
Get the config →Collect Kubernetes events as logs
Scheduling failures, image pull errors, OOM kills and probe failures as log records - kept after Kubernetes deletes the events.
Logs
Get the config →Scrape cAdvisor container metrics from the kubelet
The container_* metrics Kubernetes dashboards expect, scraped from each node's kubelet with the pod's service account token.
Metrics
Get the config →Scrape pods by prometheus.io annotations
Scrape every pod that asks for it with prometheus.io/scrape annotations, each node's collector only its own pods.
Metrics
Get the config →Collect Windows Event Log (Application, System, Security)
Application, System and Security events as structured logs - provider, event id, level, event data - without the rendered text twice over.
Logs
Get the config →Parse IIS W3C access logs into semantic conventions
Every IIS request as a structured log: method, path, query, status, sizes, time taken and user agent, with the request's own UTC timestamp.
Logs
Get the config →Collect Windows performance counters (CPU, memory, disk)
CPU busy time, available memory and free space per volume from Windows performance counters, named the way you choose.
Metrics
Get the config →Detect host and cloud resource attributes
Fill in host, environment and cloud resource attributes on the collector - without overwriting what the SDK already set.
Logs · Metrics · Traces
Get the config →Set resource attributes the sender left out
Stamp environment and namespace onto telemetry at the collector, without overwriting what an SDK already set.
Logs · Metrics · Traces
Get the config →nginx access logs to Elasticsearch, parsed into semantic conventions
Tail nginx, parse every request into semantic-convention fields with typed status codes, and index it in Elasticsearch.
Logs
Get the config →Kubernetes pod logs to Loki, enriched with deployment and cluster
Every pod's logs into Loki over OTLP, labelled with namespace, pod, container, deployment, node and cluster.
Logs
Get the config →Firewall syslog to a SIEM, with PII masked
Firewall and VPN syslog into the SIEM with user names pseudonymised and e-mail addresses masked - IPs kept for correlation.
Logs
Get the config →Prometheus counters to a delta-only backend (cumulativetodelta)
Scrape Prometheus counters and convert them to the delta temporality Dynatrace requires - gauges untouched.
Metrics
Get the config →Windows event logs, reduced: noisy events dropped, rendered text removed
Windows events with the structured fields kept, the duplicated rendered text removed and the chattiest event IDs dropped.
Logs
Get the config →