Skip to content

feat(otel-collector-tailsampling): keep shared snowplow upstream requests whole (0.1.13) - #173

Merged
braghettos merged 1 commit into
mainfrom
feat/tailsampling-keep-shared-upstream
Nov 15, 2026
Merged

braghettos merged 1 commit into
mainfrom
feat/tailsampling-keep-shared-upstream

Conversation

@braghettos

Copy link
Copy Markdown
Collaborator

Why

snowplow #1322, due after 1.12.71, lets concurrent readers of the same upstream call (same credential, in flight together) share one wire request. Each reader answered by someone else's request gets a span link on its own request span, pointing to the shared request's CLIENT span.

snowplow is a 5%-sampled service in this tail sampler. The joiner's trace and the shared request's trace are separate and sampled independently, so a kept joiner's link would resolve only about 5% of the time.

What

  • New keep rule snowplow-shared-upstream. It keeps a trace whole when a span carries snowplow.upstream.joiners > 0. snowplow agreed to set that attribute (an int count of other readers answered, present only when > 0) on the shared client span before it ends.
  • Joiners stay sampled. This is option (a) agreed with snowplow: keep the link's target, not every reader.
  • The rule matches nothing until snowplow ships #1322. The real rate will show up on snowplow's /debug/vars counters from its first hour.
  • Chart 0.1.12 → 0.1.13. No values paths are added, removed or renamed beyond this one policy entry.

Test

tests/tailsampling-docker.py adds four cases:

trace expected
shared upstream request (snowplow.upstream.joiners=2) kept
unshared upstream request (no attribute) sampled (5%)
joiners=0 (never emitted; a guard) sampled
joiner trace with a link but no marker sampled

All existing checks still pass. Negative control: against main's chart, the shared case is dropped.

🤖 Generated with Claude Code

https://claude.ai/code/session_01N8HNbDgLwRKg9uhTx5o6pn

…ests whole (0.1.13)

snowplow #1322 lets concurrent readers of the same upstream call share one wire request;
each joiner's request span links to the shared request's client span. snowplow is sampled
at 5% and the two traces are sampled independently, so a kept joiner's link would resolve
only ~5% of the time. snowplow will set snowplow.upstream.joiners (int, > 0 only) on the
shared client span; the new keep rule keeps that trace whole so every link has a target.
Joiners stay sampled. Matches nothing until snowplow ships #1322.

tests/tailsampling-docker.py: shared request kept; unshared, joiners=0 and a joiner-only
trace stay sampled. Against main's chart the shared case is dropped, as it should be.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N8HNbDgLwRKg9uhTx5o6pn
@braghettos
braghettos merged commit fb745ff into main Nov 15, 2026
14 checks passed
@braghettos
braghettos deleted the feat/tailsampling-keep-shared-upstream branch November 15, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant