Skip to content

Conversation

@zen-wego
Copy link
Contributor

@zen-wego zen-wego commented May 27, 2025

Context

Due to unoptimised fingerprinting in our existing Sentry implementation, many related events are not being grouped together.

By delegating to use the default fingerprinting algorithms in Sentry, with some additional granularity, we might be able to group events better → https://docs.sentry.io/platforms/go/guides/gin/usage/sdk-fingerprinting/

Additionally, we can accept optional parameters to enrich the event → https://docs.sentry.io/platforms/go/guides/gin/enriching-events/

Changes

  • Introduced a new ErrorData struct to carry optional Extra and Tags data, giving consumers flexibility in including more detailed context in error events.
  • Updated CaptureError and CaptureWarning functions to accept optional ErrorData parameters, maintaining backward compatibility while enabling additional context to be passed.
  • Refactored the enrichScope function for clarity.
  • Simplified the fingerprint generation logic by delegating default fingerprinting to the Sentry SDK and appending the error code for uniqueness.

Note

This PR initially contained changes that added easier attachment of tags/extras via a new ErrorData struct. To simplify the changes I've since removed them.

@zen-wego zen-wego force-pushed the sentry-optimisation branch 2 times, most recently from 3b4389f to 65fbb54 Compare May 27, 2025 09:04
@zen-wego zen-wego force-pushed the sentry-optimisation branch from 65fbb54 to 5b16e04 Compare November 20, 2025 04:07
@zen-wego zen-wego marked this pull request as ready for review November 20, 2025 04:16
@zen-wego zen-wego changed the title Enhance Sentry error capturing Enhance Sentry error fingerprinting Nov 20, 2025
@zen-wego zen-wego merged commit 1d99d83 into main Nov 26, 2025
2 checks passed
@zen-wego zen-wego deleted the sentry-optimisation branch November 26, 2025 03:58
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.

3 participants