otel-logs-v0_9 with service.name: nginx, and access-log fields arrive as OpenTelemetry HTTP attributes.
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. - nginx writing its stock
combinedaccess log to/var/log/nginx/access.logand its error log to/var/log/nginx/error.log. These are the Debian/Ubuntu defaults, and nonginx.confchanges are needed. - The OpenTelemetry Collector or Vector installed on the nginx host. The agent pages cover installation.
1
Write the agent config
Replace The Collector config (
<your-rootprint> and <your-ingest-api-key>.- OpenTelemetry Collector
- Vector
Save this as
/etc/otelcol-contrib/config.yaml.start_at: end) reads only lines written after each start, so it skips
lines written while it was stopped. Vector (read_from: end) skips existing lines on first start
only, then resumes from its checkpoint.2
Grant read access to /var/log/nginx
Set The default ACL (
AGENT_USER to the user your agent runs as, then run the lines for your distro. On
RHEL, Fedora, and Amazon Linux the logs are nginx:root with mode 0640, so grant access
with ACLs.-d) covers files logrotate creates later.3
Restart the agent
Run
sudo systemctl restart otelcol-contrib or sudo systemctl restart vector. The agent’s
log should show no config or exporter errors.4
Send a test request
Hit any site nginx serves:
5
Verify in Rootprint
Open Logs, pick
otel-logs-v0_9 from the index selector, and search for
service_name:nginx. Records typically appear within 5–10 seconds.What you get in Rootprint
Access-log entries get the HTTP attributes below, and error-log entries get process and connection attributes.nginx.format tells the two apart.
- Log level: access-log entries are always
INFO, because thecombinedformat has no level. Search onhttp.response.status_codeto find server errors. Error-log levels map toDEBUG,INFO(info,notice),WARN,ERROR, andFATAL(crit,alert,emerg). - Timestamp: taken from each log line, with the agent’s read time as a fallback.
- Error-log context: Vector also extracts
client.address,server.address,nginx.server, andnginx.upstreamfrom error lines. The Collector leaves them inbody.
Useful searches
Troubleshooting
bodyis a raw nginx line and access entries have nohttp.*attributes:nginx.confsets a customlog_format. The parsers expect the stockcombinedformat. Remove the custom format or extend the parser.- 401/403/413/415: see Response codes.
Related
- Send logs with the OpenTelemetry Collector and Send logs with Vector: install and run the agents.
- Send Caddy logs: the same setup for Caddy.
- OTLP reference: endpoint, response codes, limits.
- Indexes: the
otel-logs-v0_9schema.

