OpenTelemetry
If your application already sends its logs with OpenTelemetry, it can send them to Collector without installing any Collector package, over OTLP/HTTP. Logs only: traces and metrics keep going where they go now.
Setting up the exporter
Create a server key in the project's settings and use OpenTelemetry's logs-only variables:
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=https://app.clt.chrom.ar/otlp/v1/logs
OTEL_EXPORTER_OTLP_LOGS_PROTOCOL=http/protobuf
OTEL_EXPORTER_OTLP_LOGS_HEADERS=Authorization=Bearer%20clts_…
Write the space after Bearer as %20: that's how OpenTelemetry reads headers from environment variables. Protobuf and JSON are both accepted, gzipped or not.
If your logs go through an OpenTelemetry Collector, add Collector as one more otlphttp exporter of its logs pipeline, with the same endpoint and header. The project's Setup shows the full configuration in its OpenTelemetry tab.
How each record shows
Every OpenTelemetry record becomes a log line in Logs:
| Field in Collector | Where it comes from |
|---|---|
| Time | timeUnixNano, else observedTimeUnixNano, else when received |
| Level | severityNumber: 1–8 debug, 9–12 info, 13–16 warning, 17–20 error, 21–24 critical. Without it, severityText; else info |
| Message | The body (non-strings as JSON) |
| Logger | The instrumentation scope's name |
| Service | Resource service.name |
| Environment | deployment.environment.name, else deployment.environment |
| Release | service.version |
| Server | host.name, else service.instance.id |
| Request | The traceId: a trace's lines group like a request's |
| User | Attribute user.id, else enduser.id |
| Metadata | The record's attributes, the resource's not used above, and span_id |
Name the service and the environment (OTEL_RESOURCE_ATTRIBUTES=service.name=api,deployment.environment.name=production) to be able to filter by them.
Limits
The same server key and the same log-line budget as the SDKs. Up to 10,000 records and 10 MB per request. Records more than 7 days back or more than an hour ahead are rejected. If the project went over its budget, Collector answers 429 and the exporter retries on its own. See Limits.