Skip to content

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

Closed
JoshFerge wants to merge 3 commits into
developfrom
jferg/add-replay_id-to-dsc
Closed

feat(replays): add replay_id to dynamic sampling context#7493
JoshFerge wants to merge 3 commits into
developfrom
jferg/add-replay_id-to-dsc

Conversation

@JoshFerge

Copy link
Copy Markdown
Contributor

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
JoshFergeforce-pushed the jferg/add-replay_id-to-dsc branch from 170e040 to 0c5e17aCompareMarch 16, 2023 18:56
@AbhiPrasad

AbhiPrasad commented Mar 16, 2023

Copy link
Copy Markdown
Contributor

We should do this via hooks:

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

So:

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

And then in Replay:

// packages/replay/src/integration.tsconstclient=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.

@JoshFergeJoshFerge mentioned this pull request Mar 21, 2023
@mydea
mydea deleted the jferg/add-replay_id-to-dsc branch March 24, 2023 07:46
Sign up for freeto 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

@JoshFerge@AbhiPrasad