Skip to content

feat(#508b-1): consistent source-side sampling (SDK aggregators + otlpfilter) - #514

Closed
zzylol wants to merge 2 commits into
mainfrom
pr-b1-sampling
Closed

zzylol wants to merge 2 commits into
mainfrom
pr-b1-sampling

Conversation

@zzylol

@zzylol zzylol commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Part 1/3 of the old #510 (per-cell pipeline), now that #509 (removals) is merged.

The sampling mechanism. Each datapoint's keep/drop is a pure hash of (seed=SeedForMetric(name), occurrence=ts_ms, row) — dropped iff no row admits (the R(x)=∅ event, prob (1−p)^d). otlpfilter drops raw OTLP bytes pre-decode; the SDK aggregators re-evaluate the identical per-row decision on survivors and rescale by 1/p. Two views of ONE decision → agree with no shared RNG, no locks, idempotent.

  • opentelemetry-go-patch/sdk/metric/* — source-side sampling in the SDK aggregators.
  • asap-precompute-go/otlpfilter/* — pre-decode wire filter (self-contained; sketchlib-go/common only).

Stacked: → #512 (monitor) → #513 (integration) → #511 (eval).

🤖 Generated with Claude Code

zzylol and others added 2 commits July 8, 2026 22:47
…pfilter wire filter)

The sampling MECHANISM. Each datapoint's keep/drop is a pure hash of
(seed=SeedForMetric(name), occurrence=ts_ms, row) — R(x)=∅ iff no row admits,
prob (1-p)^d. The otlpfilter drops raw OTLP bytes pre-decode; the SDK sketch
aggregators re-evaluate the identical per-row decision on survivors and rescale
by 1/p. Two views of ONE decision, so they agree without shared RNG.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Superseded by SDK-side single-decision sampling: row admission decides
exactly once, upstream of serialization, so no downstream stage
independently re-derives it via a reproducible hash. Delete the whole
otlpfilter wire-filter package. SDK aggregators (countsketch.go,
countminsketch.go) revert to GeometricSampler — same per-series,
window-salted seed, same RowSampler interface, call sites unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@zzylol

zzylol commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by feat/gos-unified-monitoring, which is a verified superset (tree-diff confirmed: identical or additive-only for every touched file) plus ongoing work since the split. Closing in favor of a fresh PR from that branch.

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