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(tracing): Add __repr__ to Baggage #4043

Merged
merged 1 commit into from
Feb 12, 2025

Conversation

szokeasaurusrex
Copy link
Member

The default __repr__ does not show what is in the Baggage, making it extremely difficult to debug code involving Baggage objects. Add a __repr__ which includes the serialized Baggage to improve debuggability.


Thank you for contributing to sentry-python! Please add tests to validate your changes, and lint your code using tox -e linters.

Running the test suite on your PR might require maintainer approval. The AWS Lambda tests additionally require a maintainer to add a special label, and they will fail until this label is added.

@szokeasaurusrex szokeasaurusrex enabled auto-merge (squash) February 12, 2025 08:44
@szokeasaurusrex szokeasaurusrex marked this pull request as draft February 12, 2025 08:45
auto-merge was automatically disabled February 12, 2025 08:45

Pull request was converted to draft

@szokeasaurusrex
Copy link
Member Author

Gonna add a simple test

Copy link

codecov bot commented Feb 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.25%. Comparing base (c227e11) to head (9115b96).
Report is 1 commits behind head on master.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4043   +/-   ##
=======================================
  Coverage   80.24%   80.25%           
=======================================
  Files         139      139           
  Lines       15415    15417    +2     
  Branches     2606     2606           
=======================================
+ Hits        12370    12373    +3     
  Misses       2203     2203           
+ Partials      842      841    -1     
Files with missing lines Coverage Δ
sentry_sdk/tracing_utils.py 84.51% <100.00%> (+0.08%) ⬆️

... and 1 file with indirect coverage changes

@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/baggage-repr branch from 0edc902 to 53e7672 Compare February 12, 2025 08:53

Verified

This commit was signed with the committer’s verified signature.
bflad Brian Flad
The default `__repr__` does not show what is in the `Baggage`, making it extremely difficult to debug code involving `Baggage` objects. Add a `__repr__` which includes the serialized `Baggage` to improve debuggability.
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/baggage-repr branch from 53e7672 to 9115b96 Compare February 12, 2025 08:58
@szokeasaurusrex szokeasaurusrex marked this pull request as ready for review February 12, 2025 09:08
@szokeasaurusrex szokeasaurusrex enabled auto-merge (squash) February 12, 2025 09:09
@szokeasaurusrex szokeasaurusrex merged commit 2f51db7 into master Feb 12, 2025
151 checks passed
@szokeasaurusrex szokeasaurusrex deleted the szokeasaurusrex/baggage-repr branch February 12, 2025 09:13
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.

None yet

2 participants