Prerequisites
- A Linux host that runs Docker with the default
json-filelog 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
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
- In a container, write the line
{"level":"error","msg":"Squasher test error"}to stdout. - In Squasher, select Issues in the sidebar. The error is at the top of the list.
- 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.