Repository navigation
v1.21.1
OpenTelemetry traces and metrics, to Azure Application Insights or any OTLP
collector, for cloud workspaces and self-hosted installs alike. Off unless
an exporter is set: an install that sets neither variable loads none of it.
Added
- Telemetry (OpenTelemetry).
APPLICATIONINSIGHTS_CONNECTION_STRING
sends traces and metrics to Application Insights,
OTEL_EXPORTER_OTLP_ENDPOINTto any OTLP/HTTP collector (both: to both);
OTEL_SDK_DISABLED=trueturns it off. Logs are not exported: stdout
already reaches the platform's log store. See the README, "Telemetry
(OpenTelemetry)", for the variables and what is and isn't recorded.- Traces: one span per request, named by its route (
GET /docs/[slug]), with Next.js's spans, outgoing HTTP (Microsoft Graph,
the Anthropic API, Azure Blob, S3, webhooks) and the Postgres queries
(statement text, never parameter values) beneath it; one span per
background job run (job <name>) and per SMTP send./healthzand
/readyzare never traced. - Sampling: parent-based, every trace self-hosted and one in five in
cloud mode, or asOTEL_TRACES_SAMPLER/OTEL_TRACES_SAMPLER_ARGsay. - Metrics every 60 s: request duration by route, the database pool's
used, idle and waiting counts, background job runs and failures, mail
sent and failed. - Privacy: no headers beyond user-agent, content type and length and
the request id; no cookies, query strings, request paths (the route
instead), bodies, SQL parameters, email addresses or client IPs; secret
values, bearer tokens and API keys masked as in the logs. - Every span and metric carries
service.name=compassdocs, the version,
the replica,OTEL_RESOURCE_ATTRIBUTESand, in cloud mode, the
workspace (COMPASSDOCS_WORKSPACE_ID).
- Traces: one span per request, named by its route (
trace_idandspan_idon JSON log lines written inside a traced
request or job, and the request'srequest_idon its span, so a log line
leads to its trace.
Changed
- Shutdown: with telemetry on, what it holds is sent during the drain,
before the database pool closes, for at most 5 s and never past
COMPASSDOCS_SHUTDOWN_TIMEOUT. A collector that hangs or is down never
holds up the exit or stops the app; its errors are logged once each. - A malformed
APPLICATIONINSIGHTS_CONNECTION_STRINGis one warning at
start-up, never fatal.