Skip to content

fix(ingest): a span without a status no longer takes the export down - #235

Merged
vishr merged 1 commit into
mainfrom
fix/ingest-nil-status-panic
Sep 7, 2026
Merged

vishr merged 1 commit into
mainfrom
fix/ingest-nil-status-panic

Conversation

@vishr

@vishr vishr commented Sep 7, 2026 •

Copy link
Copy Markdown
Member

What changed

exportTraces read sp.Status.Code and sp.Status.Message directly. status is optional in OTLP and most SDKs omit it entirely when the status is unset, so an ordinary span panicked the handler: the connection was dropped mid-request and every span, log and metric in that export was lost with it. A collector sees an EOF and retries, and the retry panics the same way.

panic: runtime error: invalid memory address or nil pointer dereference
  internal/ingest.(*Server).exportTraces  internal/ingest/server.go:96
  internal/ingest.(*httpIngestHandler).handleExport  internal/ingest/http.go:112

Both fields read through the generated getters now, and an unset status is recorded as STATUS_CODE_UNSET.

How it was found

Pointing an OTLP exporter at a local build while verifying other work. The existing tests construct spans with a status set, which is why this survived them — the regression test posts the payload a real exporter sends instead.

Verification

  • just check
  • just test-race when auth, API, ingest, query, MCP, or agent paths changed
  • User-facing behavior and configuration docs are current
  • No credentials, private telemetry, host details, or enterprise-only source are included
  • API, migration, ingest, MCP/AG-UI, or release-contract changes are called out

Confirmed against a local instance: the same seed payload that killed the handler now ingests and rolls up.

Independent of #233 and #234 — branched from main, and worth landing first.

exportTraces read sp.Status.Code and sp.Status.Message directly. status is
optional in OTLP and most SDKs omit it entirely when the status is unset, so an
ordinary span panicked the handler: the connection was dropped mid-request and
every span, log and metric in that export was lost with it. A collector sees an
EOF and retries, and the retry panics the same way.

Found by pointing an OTLP exporter at a local build while checking other work,
which is also why the regression test posts the payload a real exporter sends
rather than the one the existing tests construct.

Both fields read through the generated getters now, and an unset status is
recorded as STATUS_CODE_UNSET.

Claude-Session: https://claude.ai/code/session_017ovmTezqzvxVP8P9MGDQNk
@vishr
vishr merged commit c2adfb3 into main Sep 7, 2026
8 checks passed
@vishr
vishr deleted the fix/ingest-nil-status-panic branch September 7, 2026 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant