Commit 8ee7dd4
authored
Respect parent_sampled decision in propagation_context sentry-trace header (#4356)
Since we don't automatically have unsampled spans running, this caused a
change in behavior when an upstream sampling decision needs to be
propagated further downstream.
### Explanation of problem
When an incoming trace has `sampled` set to 0 (`trace_id-span_id-0`),
in the past we would propagate this since we would have an active
span/transaction running but just not sampled, so downstream would also
receive `trace_id-span_id-0` from that active span.
Now, we actually don't have an active span since we don't sample (just
how otel works), so instead of sending the `trace_id-span_id-0` as
before, we would have sent `trace_id-other_span_id` from the
`propagation_context` instead.
This would cause the downstream service to not receive the `-0` flag and
would thus sample independently, which is a regression.1 parent 112c28f commit 8ee7dd4
2 files changed
+16
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
505 | 505 | | |
506 | 506 | | |
507 | 507 | | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
| 508 | + | |
513 | 509 | | |
514 | 510 | | |
515 | 511 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
432 | 432 | | |
433 | 433 | | |
434 | 434 | | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
435 | 450 | | |
436 | 451 | | |
437 | 452 | | |
| |||
0 commit comments