Commit b9f887d
committed
fix(webapp): stop api inheriting inbound sampled traceparents so trace sampling applies
The internal APM tracer's ParentBasedSampler left remoteParentSampled at its
AlwaysOn default, so any request arriving with a sampled traceparent (SDK task-run
traces propagated in from running tasks) was recorded in full, ignoring
INTERNAL_OTEL_TRACE_SAMPLING_RATE. On api that is ~99.6% of spans, so the divisor
was effectively inert.
Register a non-inheriting propagator: inject still delegates to W3C trace+baggage
so outbound propagation is unchanged, but extract drops the parent span, so every
inbound request roots its own trace and the ratio sampler applies uniformly. This
also stops api stitching onto (and inflating) the SDK's task-run traces, which is
where the untrimmable multi-thousand-span chains came from. Also set
remoteParentSampled to the ratio sampler as a fallback.1 parent 72f50c2 commit b9f887d
2 files changed
Lines changed: 40 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
17 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
18 | 26 | | |
19 | 27 | | |
20 | 28 | | |
| |||
125 | 133 | | |
126 | 134 | | |
127 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
128 | 154 | | |
129 | 155 | | |
130 | 156 | | |
| |||
281 | 307 | | |
282 | 308 | | |
283 | 309 | | |
| 310 | + | |
| 311 | + | |
284 | 312 | | |
285 | 313 | | |
286 | 314 | | |
287 | 315 | | |
288 | | - | |
| 316 | + | |
| 317 | + | |
289 | 318 | | |
290 | 319 | | |
291 | 320 | | |
| |||
324 | 353 | | |
325 | 354 | | |
326 | 355 | | |
327 | | - | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
328 | 360 | | |
329 | 361 | | |
330 | 362 | | |
| |||
0 commit comments