Commit 64b6965
authored
feat(wsgi,asgi): Introduce substitute values for filtered fields in span-streaming mode (#6178)
In the legacy (event-based) pipeline, filtered/removed values in request
data are represented as `AnnotatedValue` objects — wrappers that carry
metadata (`rem` remarks) consumed by Relay during ingestion. In
span-streaming mode, request attributes are plain strings sent directly
on spans, so `AnnotatedValue` is not appropriate there.
Previously, `_filter_headers` had a `use_annotated_value: bool`
parameter that callers set to `False` when 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:
- Adds two new substitute string constants
(`OVER_SIZE_LIMIT_SUBSTITUTE`, `UNPARSABLE_RAW_DATA_SUBSTITUTE`) for use
in the span-streaming path.
- Adds two new `AnnotatedValue` factory 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-23961 parent 3dacbf2 commit 64b6965
3 files changed
Lines changed: 51 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| 15 | + | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| 51 | + | |
| 52 | + | |
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
| |||
59 | 62 | | |
60 | 63 | | |
61 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
62 | 80 | | |
63 | 81 | | |
64 | 82 | | |
65 | 83 | | |
66 | 84 | | |
67 | 85 | | |
| 86 | + | |
| 87 | + | |
68 | 88 | | |
69 | 89 | | |
70 | 90 | | |
| |||
77 | 97 | | |
78 | 98 | | |
79 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
80 | 120 | | |
81 | 121 | | |
82 | 122 | | |
| |||
99 | 139 | | |
100 | 140 | | |
101 | 141 | | |
102 | | - | |
103 | 142 | | |
104 | | - | |
105 | 143 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
| 144 | + | |
| 145 | + | |
113 | 146 | | |
114 | 147 | | |
115 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
97 | 99 | | |
98 | 100 | | |
99 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| |||
0 commit comments