feat(wsgi,asgi): Introduce substitute values for filtered fields in span-streaming mode#6178
Open
ericapisani wants to merge 5 commits intomasterfrom
Open
feat(wsgi,asgi): Introduce substitute values for filtered fields in span-streaming mode#6178ericapisani wants to merge 5 commits intomasterfrom
ericapisani wants to merge 5 commits intomasterfrom
Conversation
…pan-streaming mode
When span streaming is enabled, sensitive headers are replaced with a
human-readable string ("[Filtered]") rather than an AnnotatedValue wrapper,
which is incompatible with the span-first data model.
Add substitute string constants (OVER_SIZE_LIMIT_SUBSTITUTE,
UNPARSABLE_RAW_DATA_SUBSTITUTE) and new AnnotatedValue factory methods
(substituted_because_raw_data, substituted_because_over_size_limit) that use
remark type "s" (substituted) instead of "x" (removed).
Update _filter_headers to auto-detect span streaming and choose the
appropriate value type, removing the use_annotated_value parameter.
Refs GH-2396
Fixes PY-2396
Member
Author
|
bugbot run |
Member
Author
|
@sentry review |
Contributor
Codecov Results 📊✅ 13 passed | Total: 13 | Pass Rate: 100% | Execution Time: 9.03s All tests are passing successfully. ❌ Patch coverage is 60.00%. Project has 14939 uncovered lines. Files with missing lines (3)
Generated by Codecov Action |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit f696766. Configure here.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0ece900. Configure here.
…AnnotatedValue methods
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

In the legacy (event-based) pipeline, filtered/removed values in request data are represented as
AnnotatedValueobjects — wrappers that carry metadata (remremarks) consumed by Relay during ingestion. In span-streaming mode, request attributes are plain strings sent directly on spans, soAnnotatedValueis not appropriate there.Previously,
_filter_headershad ause_annotated_value: boolparameter that callers set toFalsewhen building span attributes. This was fragile — callers had to know the right value, and the logic was split between call sites instead of living in one place.This PR:
OVER_SIZE_LIMIT_SUBSTITUTE,UNPARSABLE_RAW_DATA_SUBSTITUTE) for use in the span-streaming path.AnnotatedValuefactory methods (substituted_because_raw_data,substituted_because_over_size_limit) that use remark type"s"(substituted) rather than"x"(removed), for future use as the SDK fully transitions to span-first.Refs GH-6175
Fixes PY-2396