Skip to content

nri-observability: report request id as request.id field on Honeycomb spans - #162

Merged
waj merged 1 commit into
trunkfrom
pd-4073-make-branded-error-page-error-code-searchable-in-honeycomb
Aug 17, 2026
Merged

waj merged 1 commit into
trunkfrom
pd-4073-make-branded-error-page-error-code-searchable-in-honeycomb

Conversation

@waj

@waj waj commented Aug 17, 2026

Copy link
Copy Markdown
Member

Fixes PD-4073

Problem

The branded error pages added in NoRedInk/NoRedInk#55151 display an "Error code" (the per-request UUID from Platform.requestId), but that code can't be found in Honeycomb: the Honeycomb reporter mints a separate random UUID at report time for trace.trace_id and discards the request id it is handed. The request id reaches Bugsnag and file logs, but Honeycomb only sees it incidentally as http.headers.x-request-id when the client sent that header — never for browser traffic.

Fix

Keep trace.trace_id semantics unchanged (using the request id as trace id without real distributed tracing would create same-trace_id spans across services with no parent links, and span ids <uuid>-<index> would collide). Instead, thread the request id into makeSharedTraceData and stamp it on initSpan as a request.id field, so it appears on every span of the trace and traces can be looked up with request.id = <error code>. Skipped when the request id is empty (Platform.silentHandler / tests).

Also bumps nri-observability to 0.4.1.0 with a CHANGELOG entry.

Testing

  • Full nri-observability suite passes (60/60); honeycomb golden files regenerated in both golden-results-9.8 and golden-results-9.10 (they were byte-identical before, so the regenerated 9.8 outputs were copied across).
  • After the monorepo bumps its pin, end-to-end check: trigger a 404 on activities with Accept: text/html and query the dataset for request.id = <displayed error code>.

This PR was written with AI assistance.

🤖 Generated with Claude Code

… spans

The Honeycomb reporter minted a fresh UUID at report time for
trace.trace_id and discarded the request id it was handed, so the
request id shown to users (e.g. the "Error code" on branded error
pages) and propagated via X-Request-ID was not findable in Honeycomb.

Keep trace.trace_id semantics unchanged (using the request id as trace
id without distributed tracing would create same-trace_id spans across
services with no parent links) and instead stamp the request id on
every span as request.id, so traces can be looked up by it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 17, 2026 17:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@waj
waj requested review from jali-clarke and omnibs August 17, 2026 17:39

@omnibs omnibs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense

thank you!

@waj
waj added this pull request to the merge queue Aug 17, 2026
Merged via the queue into trunk with commit ebb0dd5 Aug 17, 2026
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants