Skip to main content
Collect logs and runtime metrics from Docker and Docker Compose with the OpenTelemetry Collector. The filelog receiver reads Docker’s json-file logs, while docker_stats reads CPU, memory, network, block-I/O, and container-status metrics from the Docker API.

Prerequisites

Run the Collector

Add the Collector to your docker-compose.yml and give it read access to Docker’s container log directory and API socket:
docker-compose.yml
The Collector tails the container logs, unwraps Docker’s JSON envelope, and ships to Bronto:
otel-config.yaml
Set <REGION> to eu or us. For receiver options and the full measurement list, see the Collector Contrib Docker Stats receiver.

What you will see in Bronto

Logs appear in Search. Docker’s json-file driver wraps each line as {"log": "...", "stream": "stdout|stderr", "time": "..."}; the json_parser operator promotes those into fields. Runtime measurements appear in the Metric Explorer.
Exponential histograms are not supported, and the Metric Explorer does not currently provide a Rate function.
This covers container logs and runtime metrics. To add distributed traces and per-route RED metrics for the applications in those containers, without changing them, see Zero-code instrumentation with eBPF.

Troubleshooting

  • No logs? Confirm the driver is json-file (docker inspect -f '{{.HostConfig.LogConfig.Type}}' <container>) and that the Collector mounts /var/lib/docker/containers read-only.
  • No metrics? Confirm the Collector mounts /var/run/docker.sock and its user can read the socket.
  • Per-service datasets? Run one Collector centrally with a service.name per environment, or route by container labels with an attributes processor.
  • For general issues, see OTel Collector troubleshooting.

Alternative: Fluent Bit

If you already run Fluent Bit, tail the container log files and forward them over HTTP. The docker multiline parser reassembles partial lines from the json-file driver:
fluent-bit.conf
Set Format to json_lines, not json. You can also point Docker’s native fluentd logging driver at Fluent Bit. See Connect Fluent Bit to Bronto for installation.