Skip to content

SMOODEV-2698: Session-scoped sampling + config-served telemetry settings (ADR-097 W1/W2)#75

Merged
brentrager merged 1 commit into
mainfrom
SMOODEV-2698-w1w2-sampling-core
Jul 22, 2026
Merged

SMOODEV-2698: Session-scoped sampling + config-served telemetry settings (ADR-097 W1/W2)#75
brentrager merged 1 commit into
mainfrom
SMOODEV-2698-w1w2-sampling-core

Conversation

@brentrager

Copy link
Copy Markdown
Contributor

ADR-097 W1/W2: session-scoped sampling decisions and telemetry settings served from config, with a sampling parity corpus.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ji3rA65cTfU9vPQh9HAASJ

…ngs (ADR-097 W1/W2)

Browser log volume had no control surface and, worse, no *safe* one: the
obvious fix — line-level sampling — is the exact failure ADR-010 warns about,
where you click a trace and see 5 of 47 lines with nothing telling you 42 are
missing. So the decision is made ONCE per session (or inherited from the trace,
where one exists) and applies to every line under it. Any trace you can open has
100% of its log lines. Warnings and errors are never sampled. Server logs are
untouched.

The decision is FNV-1a 32-bit over the UTF-8 bytes of the id, not random() —
random() is neither stable across a page's lifetime nor reproducible by the four
parity ports, and an unreproducible decision cannot be tested for drift.

Telemetry settings move to @smooai/config public tier (a browser can never be
served secret tier), read through an injectable provider seam so the SDK stays
usable in a test or a bundle with no network. Every failure path — unreachable,
throwing, malformed, out-of-range — lands on the compiled-in ADR-010 defaults,
never on "sample everything out": telemetry that goes quiet when its config
server hiccups is worse than useless.

parity/sampling-corpus.json pins 170 golden vectors (ADR-089 pattern) so the
Rust/Python/Go/.NET ports fail their own builds on drift rather than drifting
invisibly, as ADR-007/009 already did. Corpus paths are added to every CI lane's
change filter and to turbo's test inputs, or a corpus-only change would be
served a cached green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S2bM94GAnVjYSSv1x7HKRB
@changeset-bot

changeset-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: dda3e36

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@smooai/observability Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@brentrager
brentrager merged commit a071796 into main Jul 22, 2026
6 checks passed
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