Skip to main content
Vector reads every container’s stdout and stderr through the Docker daemon socket and ships it to Rootprint over OTLP, with the container’s name, ID, and image attached. To tail specific files instead, see Vector, OpenTelemetry Collector, or Fluent Bit.

Prerequisites

  • A running Rootprint instance. Substitute its host for <your-rootprint>.
  • An ingest API key scoped to otel-logs-v0_9. Create one in Settings → API keys with Create ingest key, then substitute it for <your-ingest-api-key>. See API keys.
  • A Linux host with Docker and Docker Compose.
Mounting /var/run/docker.sock gives the Vector container full access to the Docker API. The :ro flag doesn’t restrict API calls.
1

Write the config

Save this as vector.yaml next to your docker-compose.yml. Replace <your-rootprint> and <your-ingest-api-key>.
2

Add the Vector service to your compose file

Your application services need no changes.
Keep container_name and exclude_containers in vector.yaml identical. That’s how Vector skips its own logs.
3

Start Vector

4

Send a test log line

The sleep calls give Vector time to attach before --rm removes the container.
5

Verify in Rootprint

Open Logs, pick otel-logs-v0_9 from the index selector, and search for hello from rootprint. Records typically appear within 5–10 seconds. service_name reads rootprint-smoke-test, and attributes.container.image.name reads alpine.

What you get in Rootprint

service_name is the container name without Docker’s leading /, or unknown_service when there is none. The log level is inferred from the lowercased message:
  • error, fatal, panic, or exception (whole word) → ERROR
  • warn, warning, or deprecated → WARN
  • anything else → INFO
DEBUG is never inferred. If a container writes JSON to stdout, the body arrives as a JSON string. Add a parse_json call to the remap and push the parsed fields onto attrs. Container labels aren’t promoted by default. To promote one, add this to the remap before the . = { ... } assignment:

Troubleshooting