Skip to content

feat: tag swap/bridge Sentry traces - #10893

Open
micaelae wants to merge 7 commits into
mainfrom
swaps5184-trace-tags
Open

micaelae wants to merge 7 commits into
mainfrom
swaps5184-trace-tags

Conversation

@micaelae

@micaelae micaelae commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Explanation

Adds Sentry tags to swap/bridge traces that indicate the active feature (swap, batch sell, quick buy, etc). The tags can be used to filter traces in in Sentry.

This change also exports shared trace types (SwapTraceRequest, SwapTraceFunction, TraceFeatureTag) so mobile and extension send the same tags.

Client PRs

References

Fixes https://consensyssoftware.atlassian.net/browse/SWAPS-5184

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Breaking API change for all BridgeController and BridgeStatusController consumers that must supply traceFn; telemetry behavior changes but core swap/bridge logic is largely unchanged aside from sync trace calls and error swallowing on quote paths.

Overview
Standardizes swap/bridge Sentry tracing so controllers and clients share typed trace contracts and consistent feature tagging.

BridgeController and BridgeStatusController now require a traceFn at construction (the previous optional no-op default is removed). Controllers use a shared SwapTraceFunction / SwapTraceRequest shape that mandates tags.feature, populated from the active feature_id via BRIDGE_FEATURE_ID_TO_FEATURE_TAG (exported as SwapFeatureTag along with related trace name helpers).

Quote and transaction traces in both packages now attach tags: { feature: 'swap' | 'batch_sell' | ... } on events such as quote fetch, provider first result, and swap/bridge transaction completion. bridge-controller also expands exported TraceName values for client-side traces and wraps telemetry in try/catch so a failing traceFn cannot break quote fetching.

Tests and changelogs are updated for the breaking constructor change and new trace payloads.

Reviewed by Cursor Bugbot for commit e0107cf. Bugbot is set up for automated code reviews on this repo. Configure here.

@micaelae
micaelae requested review from a team as code owners October 19, 2026 20:19
@micaelae
micaelae deployed to default-branch October 19, 2026 20:19 — with GitHub Actions Active

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Comment thread packages/bridge-controller/src/bridge-controller.ts Outdated
Comment thread packages/bridge-controller/src/types.ts Outdated
Comment thread packages/bridge-controller/src/index.ts
@micaelae
micaelae force-pushed the swaps5184-trace-tags branch from a307ca8 to 751e316 Compare October 19, 2026 21:06

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Comment thread packages/bridge-status-controller/src/bridge-status-controller.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ef7c179. Configure here.

Comment thread packages/bridge-controller/src/bridge-controller.ts
@micaelae
micaelae enabled auto-merge October 19, 2026 22:43
@micaelae
micaelae added this pull request to the merge queue Oct 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 20, 2026

This branch was successfully deployed

1 active (outdated) deployment
default-branch — 91088519 Deployed Oct 19, 2026 by micaelae via Determine whether this PR is a release PR #5664
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