Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 1.66 KB

File metadata and controls

36 lines (27 loc) · 1.66 KB

OTLP output

Point otel.endpoint at any OTLP/HTTP receiver. The plugin appends /v1/logs for logs and /v1/traces for session spans.

Log records

Each event produces one OTLP/HTTP-JSON log record. Alongside the routed command output, every record carries:

  • resource.service.name — from otel.service_name
  • attributes — copilot.event, copilot.session_id, copilot.cwd, and copilot.tool_name when present, plus the copilot.<name> command attributes
  • severityTextINFO
  • traceId — the Copilot session UUID (so all of a session's records share one trace id); spanId is the session span's id when session tracing is on

Session traces

With otel.session_trace = true (the default), the plugin also emits one span per Copilot session:

  • SessionStart records the session's start time (in a temp marker file).
  • SessionEnd POSTs a completed copilot.session span to {endpoint}/v1/traces with the session's duration and copilot.session.end_reason.

The span's traceId is the Copilot session UUID (dashes removed — a UUID is exactly a 16-byte OTLP trace id), and every log record in the session uses that same traceId and the session span's spanId — so all of a session's logs attach to its trace and nest under the session span in trace views. Nothing is invented: the trace id equals the copilot.session_id attribute, so you can look a session up either way. (A non-UUID session id falls back to a stable hash.)

Set session_trace = false to disable, or session_span_name to rename the span. Requires the SessionStart/SessionEnd hooks (registered by default) and an OTLP traces receiver at {endpoint}/v1/traces.