Skip to content

The request span starts a new trace instead of continuing the caller's #660

Closed

Description

@athvin

Complete 2026-11-09 · release mvp

er-server's http.server span started a fresh root trace instead of continuing the caller's — a click in the browser and the request it caused were two unrelated traces. The fix is merged. What remains is one missing gate and the live re-probe.

Landed on main, verified 2026-11-07 against origin/main

All four changes the WIP branch carried are merged (the branch merged in the 2026-11-06 history rewrite; edf6df5e no longer resolves):

  • telemetry.rs:187-188 — make_span adopts an acceptable incoming traceparent (er_obs::adopt_traceparent), so the request span continues the caller's trace
  • lib.rs:556 — forwarded_traceparent_header: one rule decides both the span's parent and the value stored on jobs.trace_context
  • otlp.rs:271 — Sampler::AlwaysOn stated explicitly, so a caller sending …-00 cannot silence this process's spans
  • pg.rs:1292 — audit_rows returns trace_id via er_obs::current_trace_id()

The test surface this issue demanded also exists: er-server/tests/telemetry_trace_continuation.rs asserts the exported span's lineage — the sixteen raw trace-id bytes and remote parentage through a loopback collector — including the future-version discriminator between the two readings of a traceparent. The dev-dependency obstacle was solved the preferred way: an er-obs test-support feature (er-server/Cargo.toml:149, harness in er-obs/src/testing.rs), so the opentelemetry pins never entered er-server's dev-deps.

The evidence (as found 2026-11-05)

Two requests sent through a port-forward to the live web-api carrying traceparent: 00-d1c5611baf8b3b4988eec802e66125be-…-01: er_action = 'run.start' was present on the GET /v1/orgs span, but the trace id sent appeared on nothing. The cause was one missing call — er_obs::adopt_traceparent had exactly one caller (dispatcher.rs), and telemetry::make_span built its span with no current parent.

What remains

  • audit_log.trace_id gate — landed: audit_rows_carry_the_requests_trace_id in pg_orgs.rs (gate: prove audit_log.trace_id is populated — pg_orgs.rs phase (from #660) #840) asserts a request carrying a traceparent writes an audit row whose trace_id is that trace id, and one without writes null.
  • Live re-probe — done 2026-11-09 00:25 UTC: POST /v1/orgs to the live web-api-green pod carrying traceparent: 00-cc33cc33cc33cc33cc33cc33cc33cc33-00f067aa0ba902b7-01 returned 422, and the exported http.server span is queryable in OpenObserve under trace id cc33cc33cc33cc33cc33cc33cc33cc33 — the caller's trace id adopted end to end. (The probe first exposed an unrelated span-export outage on the previous pod, filed separately.)

Found 2026-11-05 while verifying the programme against live data rather than against its own merge history; revised 2026-11-07 after the fix landed on main. #552 states "the OTel programme is complete end to end"; that is accurate for the job path and, with this merge, the request path in code — pending the live probe above.

Activity

  1. added
    mvp
    obs-backlog
    on Nov 6, 2026
  2. athvin commented on Nov 8, 2026

    @athvin
    OwnerAuthor

    Split 2026-11-08 (session claiming the gate half)

    The two remaining items are now separable by access:

  3. self-assigned this
    on Nov 8, 2026
  4. athvin commented on Nov 8, 2026

    @athvin
    OwnerAuthor

    Claimed — working in #847 (draft). Closing that PR releases the claim.

  5. removed their assignment
    on Nov 8, 2026
  6. athvin commented on Nov 8, 2026

    @athvin
    OwnerAuthor

    Claim released — parked as blocked on a human aws sso login (see PR #847's Context block for the full diagnosis: deploy proven at image 7fdf5b32; the probe needs pods/portforward, which read-only deliberately lacks and which PlatformAdmin already has). Coordinator has the SSO ask with the user as non-blocking FYI. The card stays In progress, unclaimed.

  7. athvin commented on Nov 8, 2026

    @athvin
    OwnerAuthor

    State update (2026-11-08): the first open box is done — PR #840 landed audit_rows_carry_the_requests_trace_id in pg_orgs.rs:562 (a traceparent-carrying request writes its trace id to the audit row; a non-HTTP caller writes NULL). The only residue is the live re-probe against the deployed web-api, which needs cluster access (er-platform + port-forward) — left for a session that can run the guard-escalated kubectl.

  8. self-assigned this
    on Nov 8, 2026
  9. athvin commented on Nov 8, 2026

    @athvin
    OwnerAuthor

    Claimed by an agent session — 2026-11-08T23:55:52Z, session 01a1b892-4cde-7a53-bb3e-9ed2e764acdc on Mac. The claim is the open draft PR; closing it releases the ticket. SSO is live again (the parked blocker), so the live re-probe runs now; the audit trace_id gate lands as a small PR.

  10. athvin commented on Nov 9, 2026

    @athvin
    OwnerAuthor

    Live re-probe, 2026-11-09 00:25 UTC — closed.

    Probe. POST /v1/orgs to the live web-api-green pod (ci namespace) with operator bearer and traceparent: 00-cc33cc33cc33cc33cc33cc33cc33cc33-00f067aa0ba902b7-01. Response 422 (deliberate — no side effects, and the collector's mutations tail-sampling policy keeps POST traces).

    Result. The exported http.server span is in OpenObserve under trace id cc33cc33cc33cc33cc33cc33cc33cc33 — the api adopted the caller's trace id; browser-click → request → one trace, the original defect, is verified fixed in the running system. The audit-row half of the gate landed as audit_rows_carry_the_requests_trace_id (#840).

    What the probe cost, for the record. The first probe (00:04 UTC, trace id d1c5611baf8b3b4988eec802e66125be for continuity with the 2026-11-05 evidence) never arrived — nor did any other er-api span from that pod, which exported zero spans in its 40-minute lifetime while its metrics flowed normally. The collector, the tail-sampling policies, the network and the image were each eliminated in turn (a synthetic er-api span injected from the same pod landed fine; the image's only Rust delta vs. the last-exporting build was #792's additive env-filter; a pod restart restored export immediately). Filed as a separate ticket: span export dies silently per-pod and nothing alarms on the absence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

mvpobs-backlog

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions