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(profiling): add platform header to the chunk item-type in the envelope #4178

Merged
merged 4 commits into from
Mar 21, 2025

Conversation

viglia
Copy link
Contributor

@viglia viglia commented Mar 20, 2025

We need to send the platform as part of the headers in the chunk item-type as this is the header that relay is checking to manage rate limiting.

@viglia viglia self-assigned this Mar 20, 2025
@viglia viglia requested review from a team, indragiek and phacops March 20, 2025 16:10
Copy link

codecov bot commented Mar 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.53%. Comparing base (5715734) to head (1002ac6).
Report is 4 commits behind head on master.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4178      +/-   ##
==========================================
- Coverage   79.56%   79.53%   -0.04%     
==========================================
  Files         141      141              
  Lines       15736    15736              
  Branches     2675     2675              
==========================================
- Hits        12520    12515       -5     
- Misses       2369     2376       +7     
+ Partials      847      845       -2     
Files with missing lines Coverage Δ
sentry_sdk/envelope.py 80.09% <ø> (ø)

... and 6 files with indirect coverage changes

Item(
payload=PayloadRef(json=profile_chunk),
type="profile_chunk",
headers={"platform": profile_chunk.get("platform")},
Copy link
Contributor

Choose a reason for hiding this comment

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

I wouldn't mind to avoid any potential None value here. Can we hardcode the same value we set in profile_chunk? Or only add the headers if we have a key platform?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@phacops I could throw-in an extra check if you wish but just fyi: if profile_chunk.get("platform") returns None it means the platform is not set at the payload either and therefore the whole profile would be rejected as it does not comply to the Relay defined schema (platform is a mandatory field).

Copy link
Contributor

Choose a reason for hiding this comment

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

True. I'm just allergic to null values.

@viglia viglia requested a review from sentrivana March 21, 2025 08:39
@viglia viglia merged commit ce9d784 into master Mar 21, 2025
140 checks passed
@viglia viglia deleted the viglia/feat/add-platform-header-to-profile-item-type branch March 21, 2025 10:17
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