Skip to content

feat(telemetry): send devops-cli logs with trace ids to Loki #813

Description

@dan-petty

Context & Rationale

  • devops-cli exports only /v1/metrics and /v1/traces (src/devops_cli/telemetry/tracer.py:890, 1128).
  • The collector's logs pipeline goes only to debug (k8s/otel/values.yaml:101-104).
  • TraceCorrelationFilter already stamps trace_id and span_id on log records (src/devops_cli/telemetry/logging_bridge.py:10-18).
  • Grafana's Loki datasource has no derived field linking to Jaeger (k8s/monitoring/grafana-values.yaml:46-53).
  • Routing logs from the collector to Loki needs an ingress rule for the otel namespace in k8s/logging/networkpolicy.yaml.

Scope & Deliverables

  • Deliverable:
    • OTLP log export of WARNING and above, carrying trace ids.
    • A collector exporter to Loki, plus the network-policy rule.
    • A Loki derived field from trace_id to Jaeger.
    • A devops-cli error-stream panel.
  • Acceptance criteria: A failing command's log line appears in Loki with its trace id, and the derived link opens the trace in Jaeger. Tests stay offline.
  • Constraint: No prompt or reply text in logs (feat(ai): model prompt and reply text kept out of telemetry by default #606).

Strategic Alignment

Update 2026-10-08: refinement

Two deliverables landed: logs reach Loki (k8s/otel/values.yaml:77-81, #922), and Loki admits the collector (#1100). Open: devops-cli exports no logs (telemetry/tracer.py:853, :1102), no derived field, no error panel. (proposed) The export uses the SDK's LoggerProvider behind #1319's seam; the derived field targets the deployed trace datasource.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p3-lowscope/telemetrytype/feature

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions