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

fix(profiling): Transfer profile ID when the event has been extracted #2733

Merged
merged 5 commits into from
Nov 20, 2023

Conversation

jjbayer
Copy link
Member

@jjbayer jjbayer commented Nov 16, 2023

Relay copies profile IDs into a transaction context in order to associate profiles to transactions.

In #2715, we tried to move this extraction to a point before dynamic sampling, so we can define transaction sampling rules based on the profile ID. However, the PR tried to do this at a point where the event had not been parsed yet, resulting in the profile ID always missing.

As @olksdr pointed out,

It might be a good idea to add a test for this, to make sure that profile id will be added where it's needed.

@@ -2756,6 +2769,7 @@ impl EnvelopeProcessorService {
});

self.extract_event(state)?;
self.transfer_profile_id(state);
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the main change of this PR: The transfer of the profile ID happens after event extraction. The rest of the PR is largely identical with #2715.

@jjbayer jjbayer changed the title Fix/profile id transfer fix(profiling): Transfer profile ID when the event has been extracted Nov 16, 2023
@jjbayer jjbayer requested a review from phacops November 16, 2023 18:35
@jjbayer jjbayer marked this pull request as ready for review November 16, 2023 18:35
@jjbayer jjbayer requested a review from a team November 16, 2023 18:35
Copy link
Contributor

@olksdr olksdr left a comment

Choose a reason for hiding this comment

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

let's 🚢 it again!

Comment on lines 4454 to 4456

#[tokio::test]
async fn test_profile_id_transfered() {
Copy link
Contributor

Choose a reason for hiding this comment

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

does this have to be tokio::test and async?

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 It can be sync if I use dummy Addrs instead of mock_service. Changed here: e68e1ba

@jjbayer jjbayer merged commit 7b68b71 into master Nov 20, 2023
20 checks passed
@jjbayer jjbayer deleted the fix/profile-id-transfer branch November 20, 2023 11:08
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