Skip to content

chore: update Go dependencies#81

Open
keegancsmith wants to merge 3 commits into
mainfrom
k/buimp-deps
Open

chore: update Go dependencies#81
keegancsmith wants to merge 3 commits into
mainfrom
k/buimp-deps

Conversation

@keegancsmith

@keegancsmith keegancsmith commented Jul 7, 2026

Copy link
Copy Markdown
Member

Ran go get -u -t ./... and fixes the Sentry sink incompatibilities exposed by the newer SDK. The updated sentry-go release removed scope extras and expanded the transport interface, so Cockroach error details are now attached as event context and the test transport implements the new methods.

The newer SDK also owns the reserved Sentry trace context for error events. After checking with Robert on the original tracing intent, this PR deliberately keeps the simple behavior: the real logger TraceId / SpanId values remain preserved in the existing log context, and we do not add extra logic to populate Sentry-native trace linking.

keegancsmith and others added 2 commits July 7, 2026 13:36
The dependency refresh pulls in a newer sentry-go release that removed the old extras API and expanded the Transport interface. Preserve Cockroach error details by attaching them as Sentry context on error events, and update the test transport to satisfy the new interface.

The newer SDK also owns the reserved trace context for error events, so the Sentry sink should keep logger trace fields in the log context instead of asserting that arbitrary log trace strings become native Sentry trace IDs.

Amp-Thread-ID: https://ampcode.com/threads/T-019f3c5a-ff88-737d-a6ce-24e4e12b0283
Co-authored-by: Amp <amp@ampcode.com>
Sentry's trace context is reserved and the newer SDK now owns how it is attached to error events. Instead of setting contexts.trace directly, parse valid logger trace/span IDs into the scope propagation context so sentry-go emits a conforming trace context while still leaving free-form trace values in the log context.

Amp-Thread-ID: https://ampcode.com/threads/T-019f3c5a-ff88-737d-a6ce-24e4e12b0283
Co-authored-by: Amp <amp@ampcode.com>
@keegancsmith

Copy link
Copy Markdown
Member Author

@bobheadxi do we actually use the sentry tracing stuff? Reason is I got amp to migrate to the latest sentry sdk and run into issues which I'm not exactly sure we can support properly.

Here is amp's answer on what it did and what to ask you :) I’m updating sourcegraph/log deps and sentry-go moved from v0.21.0 to v0.47.0. That broke the Sentry sink in two places:

  1. Scope.SetExtras was removed, so I moved the Cockroach error extraDetails into a Sentry context instead.
  2. More importantly, the newer SDK now owns/populates the reserved contexts.trace field from its propagation context. The old code from your PR sentrycore: emit trace ID, span ID in Sentry-specific trace context as well #66 used scope.SetContext("trace", …) directly to reflect logger TraceId / SpanId into Sentry’s specialized trace context, but with the new SDK that gets overwritten for error events.
    I reread the Sentry trace context spec. It says trace_id must be 16 random bytes / 32 hex chars, and span_id is also required for non-transaction events; if performance monitoring is disabled it can be random, but should preferably be stable within the unit of execution.
    Based on that, Amp changed the implementation to:
  • keep logger TraceId / SpanId in the existing "log" context as before;
  • if the logger trace/span IDs are valid Sentry-shaped IDs, parse them into sentry.PropagationContext and call scope.SetPropagationContext(...), letting sentry-go emit the conforming reserved contexts.trace;
  • if there’s a valid trace ID but no span ID, generate a Sentry span ID so the trace context is valid;
  • if the IDs are invalid/free-form, leave them only in the "log" context rather than forcing invalid data into contexts.trace.
    Does that preserve the intent of your original PR sentrycore: emit trace ID, span ID in Sentry-specific trace context as well #66? In particular, are you OK with only populating Sentry’s specialized trace context when the log trace fields are valid 32-char/16-char hex IDs, and otherwise keeping them as log context only?

@bobheadxi

Copy link
Copy Markdown
Member

@keegancsmith yes that sounds fine! I actually don't really care about the Sentry traces as they turned out to not be very good, as long as we keep the real trace IDs its probably fine

@keegancsmith

keegancsmith commented Jul 7, 2026 via email

Copy link
Copy Markdown
Member Author

@bobheadxi

Copy link
Copy Markdown
Member

yeah, let's just do the simple logging of our trace IDs

@keegancsmith keegancsmith changed the title Update Go dependencies chore: update Go dependencies Jul 7, 2026
@keegancsmith keegancsmith marked this pull request as ready for review July 7, 2026 19:11
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.

2 participants