getsentry / sentry-python

The official Python SDK for Sentry.io
https://sentry.io/for/python/
MIT License
1.93k stars 509 forks source link

fix: include_tracing_fields arg to control unvetted data in rust_tracing integration #3780

Closed matt-codecov closed 1 week ago

matt-codecov commented 1 week ago

implemented my suggestion from https://github.com/getsentry/sentry-python/pull/3778 so that if anton agrees we can merge this before the weekend

this PR renames the send_sensitive_data flag to include_tracing_fields. the data in question is generally data the user expects tracing to record or data they explicitly passed into a log statement to be recorded, so if we call it "sensitive" they may think we are referring to something else

also, this PR applies the same condition to both on_record() and on_new_span(). both callbacks set the same fields, so they should either both be redacted or both be allowed. previously only on_record() had the condition applied.


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.

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 84.30%. Comparing base (4bec4a4) to head (10e3d9c). Report is 1 commits behind head on master.

:white_check_mark: All tests successful. No failed tests found.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #3780 +/- ## ========================================== + Coverage 84.26% 84.30% +0.03% ========================================== Files 137 137 Lines 14558 14561 +3 Branches 2459 2460 +1 ========================================== + Hits 12268 12275 +7 + Misses 1530 1528 -2 + Partials 760 758 -2 ``` | [Files with missing lines](https://app.codecov.io/gh/getsentry/sentry-python/pull/3780?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getsentry) | Coverage Δ | | |---|---|---| | [sentry\_sdk/integrations/rust\_tracing.py](https://app.codecov.io/gh/getsentry/sentry-python/pull/3780?src=pr&el=tree&filepath=sentry_sdk%2Fintegrations%2Frust_tracing.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getsentry#diff-c2VudHJ5X3Nkay9pbnRlZ3JhdGlvbnMvcnVzdF90cmFjaW5nLnB5) | `84.61% <100.00%> (+0.32%)` | :arrow_up: | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/getsentry/sentry-python/pull/3780/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getsentry)