Skip to main content
The OpenTelemetry Collector tails log files and ships each line to Rootprint over OTLP. Records land in the index your ingest API key is scoped to: otel-logs-v0_9 in this guide.

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 Compose if you run the Collector in a container.
  • The Collector Contrib distribution (otelcol-contrib), v0.149 or newer. The core distribution has no file_log receiver.
1

Write the config

Replace <your-rootprint>, <your-ingest-api-key>, the include glob, and myapp with your service name.
start_at: end reads only lines written after the Collector starts. Set it to beginning for a one-time backfill.
2

Run the Collector

Install otelcol-contrib from the Collector installation page. The Debian and RPM packages run the otelcol-contrib service as the otelcol-contrib user and read /etc/otelcol-contrib/config.yaml.
  1. Save the config as /etc/otelcol-contrib/config.yaml.
  2. Let the service user read the log files. On Debian/Ubuntu, /var/log files usually belong to the adm group:
    Alternatively, sudo chmod a+r the log files. That opens them to every user on the host.
  3. Restart the service and check its log for config or exporter errors:
3

Send a test log line

4

Verify in Rootprint

Open Logs, pick otel-logs-v0_9 from the index selector, and search for hello from the otel collector. Records typically appear within 5–10 seconds.

What the config does

  • file_log: emits one record per line, with the raw line in body. To parse fields out of the line, add a json_parser or regex_parser under the receiver’s operators.
  • resource: sets the service.name resource attribute, which fills Rootprint’s service_name column.
  • logs_endpoint: the full URL, including /v1/logs. Don’t use endpoint, which appends the path itself.
  • batch: groups records before export. Tune send_batch_size and timeout for latency or batch size.

Troubleshooting

  • unknown type: "file_log" or unknown type: "otlp_http" on startup: you are running the core Collector or a Contrib release older than v0.149. Install or upgrade otelcol-contrib.
  • 401/403/413/415: see Response codes.