Skip to main content
An OpenTelemetry Collector on the Docker host reads the log files of every container and forwards them to Squasher. The same Collector can receive traces and logs from your apps. For host and container resource metrics, use Host and Docker metrics.

Prerequisites

  • A Linux host that runs Docker with the default json-file log driver.
  • Docker Compose.
  • An ingest key in the environment as SQUASHER_API_KEY. See Create an ingest key.

Set up the Collector

1

Configure the Collector

The second json_parser reads the level from container lines that are JSON. Plain-text lines have no level.
otel-config.yaml
2

Add the Collector to Docker Compose

The Collector runs as root so that it can read the container log files.
docker-compose.yml
3

Start it

To send traces from your apps, set OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318 in their containers. See OpenTelemetry for each language.

What Squasher keeps from each record

Every container line gets the service name docker-host and the environment production from the resource processor. Apps that send OTLP keep their own values.

Verify

  1. In a container, write the line {"level":"error","msg":"Squasher test error"} to stdout.
  2. In Squasher, select Issues in the sidebar. The error is at the top of the list.
  3. Select Logs in the sidebar to see the other container lines.

Limits

  • Plain-text lines have no level, so they create no issues, even on stderr.
  • Docker Desktop on macOS and Windows keeps container logs inside a virtual machine. Run this setup on a Linux host.

Next steps

Host and Docker metrics

Send CPU, memory, and container metrics.

Kubernetes

Collect pod logs and workload metrics with Helm.