Skip to content

tools(sentry): org-wide volume report + measure on submitted, not accepted - #172

Merged
dzianisv merged 4 commits into
mainfrom
age-105-sentry-volume-report
Aug 14, 2026
Merged

tools(sentry): org-wide volume report + measure on submitted, not accepted#172
dzianisv merged 4 commits into
mainfrom
age-105-sentry-volume-report

Conversation

@dzianisv

Copy link
Copy Markdown
Owner

Follow-up tooling for [AGE-105]. The "done" condition there is a measured Sentry rate, and re-deriving it by hand each heartbeat is how before/after comparisons quietly stop being comparisons.

The correction that matters

accepted is the wrong headline metric. The org is over its error quota, so Sentry rejects nearly everything:

== 7h, 2026-08-14 07:00-14:00Z (after the box-bot fix, before the mobile rollout)
project                   submitted  accepted  rate_lim  cli_disc    sub/h    sub/mo
opencode-mobile                  33         0        33        24     4.71     3,441
openclaw-ci                       4         0         4         0     0.57       417
vibe-api-gateway                  1         0         1         0     0.14       104
ORG TOTAL (submitted)            38                                   5.43     3,963

Every project reads accepted: 0. On that column a blown org and a perfectly fixed one are indistinguishable. submitted = accepted + rate_limited is the demand the clients actually put on the wire, which is what the 3,500/month gate is about.

What this adds

  • scripts/sentry-volume-report.mjs — read-only, takes named --window name=START..END ranges (now allowed), prints per-project submitted/accepted/rate_limited/client_discard plus per-hour and projected per-month rates. --json for machine use. No deps.
  • docs/analytics.md — how to run it, why submitted and not accepted, and the recorded pre-rollout baseline.

Baseline recorded for the v0.4.14 comparison

opencode-mobile at 4.71/h → 3,441/month, 87% of the org's post-box-bot demand. Two independent windows (7h post-box-bot-fix, and the 7d trailing average) agree to within 0.2%, which is the useful part — it means the after-number will be comparable rather than a diurnal artifact.

Verified by running it against the live org for all three windows in the table above.

engineer and others added 2 commits August 14, 2026 07:47
…re on

The AGE-105 gate is a measured number, so it needs a repeatable query. It also
needed a correction: `accepted` is the wrong headline. The org is over its error
quota, so Sentry rejects nearly everything and `accepted` reads ~0 for every
project - a blown org and a fixed one look identical on that column. The demand
metric is `submitted` = accepted + rate_limited.

scripts/sentry-volume-report.mjs takes named --window ranges and prints
per-project submitted / accepted / rate_limited / client_discard plus the
per-hour and projected per-month rate, so before/after comparisons run the exact
same query instead of being re-derived by hand each time.

Records the pre-rollout baseline in docs/analytics.md: opencode-mobile at
4.71/h (3,441/mo), 87% of the org's post-box-bot demand, from two windows that
agree to within 0.2%.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
The gate's unit tests prove it behaves as specified. Nothing proved the spec
was aimed at the right targets. Replaying the actual 90d census of the
opencode-mobile Sentry project (648 events, 11 issues) through the gate's own
precedence shows 96.9% hard-dropped as transport noise and every observed crash
class (OOM, ANR, IllegalStateException) still allowlisted -> ~87 events/month
against a 1,500/month target.

Also records two findings from measuring the org directly:

* The error quota resets on the 4th. The 5,000-event month opened 2026-08-04
  and was spent by 08-08; the org has accepted zero errors since. 2026-09-04 is
  the date the gate has to hold by, and it is why 'submitted' is the metric.
* Server-side levers are unavailable on this plan. A per-key rate limit PUT
  returns HTTP 200 and silently discards the value (verified for three window
  sizes), custom inbound filters are absent, spike protection 403s. The client
  gate is the only control that exists, so its coverage is the whole margin.

Refs AGE-105

Co-Authored-By: Paperclip <noreply@paperclip.ing>
@dzianisv
dzianisv force-pushed the age-105-sentry-volume-report branch from dc97fdc to 1a32ba3 Compare August 14, 2026 14:59
engineer added 2 commits August 14, 2026 08:05
…nfused with quota backoff

Raw client_discard cannot show whether the noise gate works. Today 100% of
opencode-mobile's client_discard is ratelimit_backoff -- the SDK backing off a
429 because the ORG is over quota -- which rises when things get WORSE. Gate
drops land in a different reason: @sentry/core records before_send when
beforeSend returns null.

- stats_v2 now groups by reason as well as project/outcome
- the before_send vs ratelimit_backoff split always prints; --by-reason adds
  the full per-project reason table
- before_send > 0 is install-share-independent, so it proves the gate is live
  on real devices days before a monthly rate can bend
- documents that release-level segmentation is impossible while over quota:
  rate_limited events are never stored, so release tags stop (last value
  0.4.12, 2026-08-08). Version share comes from Play, not Sentry.
The AGE-105 quota fix is entirely client-side (every server-side lever on
this plan is dead), so the gate being *in the shipped binary* is the whole
safety margin. That is also the one thing Sentry cannot tell us: while the
org is over quota nothing is stored, release tags stop dead at 0.4.12, and
a release:0.4.14 query returns empty in a way that reads like success.

Grep the Hermes bundle inside the AAB instead, before the Play upload step:
the gate's reason codes, the transport drop-list regex, the
noise.dropped_since_last tag only applyNoiseGate() writes, and a baked-in
DSN (a release built without EXPO_PUBLIC_SENTRY_DSN makes Sentry a silent
no-op). Verified to discriminate on real artifacts - the v0.4.14 build now
on Play production passes, pre-gate v0.4.13 fails all six markers.

Also records the rejected alternative: persisting gate state across cold
starts pays off only under ~94 active devices (2,633 session envelopes/7d
vs a 6h cooldown), and the install base is above that.
@dzianisv
dzianisv merged commit 2cc284e into main Aug 14, 2026
8 checks passed
@dzianisv
dzianisv deleted the age-105-sentry-volume-report branch August 14, 2026 15:50
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