Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(replays): add replay_id to dynamic sampling context #7493

Closed
wants to merge 3 commits into from

Conversation

JoshFerge
Copy link
Member

Only used for testing // as a reference for what we want to do. need to determine how to do this while preserving tree shaking, etc.

@JoshFerge JoshFerge force-pushed the jferg/add-replay_id-to-dsc branch from 170e040 to 0c5e17a Compare March 16, 2023 18:56
@AbhiPrasad
Copy link
Member

AbhiPrasad commented Mar 16, 2023

We should do this via hooks:

// Keep on() & emit() signatures in sync with types' client.ts interface

So:

// packages/core/src/tracing/transaction.ts
const client = getCurrentHub().getClient();
client.emit('dscCreate', dsc);

And then in Replay:

// packages/replay/src/integration.ts
const client = getCurrentHub().getClient();
client.on('dscCreate', (dsc) => {
  if (!this._replay || !this._replay.session) {
    return;
  }
  dsc.replay_id = this._replay.session.id;
});

This will mean Replay is treeshaken if not used, and will have minimal bundle size impact.

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