trace_id — no Sentry SDK required.
Setup
- Create (or open) a project in Sentry and copy its DSN from Settings → Projects → Client Keys (DSN).
- Set the environment variable:
- Wire the transport:
- Trigger a request and open Explore → Logs in Sentry.
Environment Variables
Options
Plus the shared batching options:
maxBatchSize, flushIntervalMs, timeout, retries — see the overview.
Payload
Logs post to the project’s envelope endpoint as Sentry log items:- Body — the log message, or
GET /pathfor access logs. - Level —
DEBUG→debug,INFO→info,WARNING→warn,ERROR→error. - Attributes — meta fields flattened to typed attributes (
string,integer,double,boolean):request.method,status,durationMs,context.requestId, and anything you merge into the request context. - Trace ID — reused from
context.trace_idwhenlogixlysia/otelinjected one (linking logs to the trace), otherwise generated.
status:500 or context.requestId:0d5e….
Troubleshooting
401/403— the DSN was revoked or belongs to another project; copy a fresh one from Client Keys.invalid DSNat startup — the expected shape ishttps://<public-key>@<host>/<project-id>.- Logs don’t link to traces — make sure
trace_idreaches the request context vialogixlysia/otel.