fix(telemetry): cap CLI event volume and switch PostHog to anonymous …#2829
Merged
Vaibhaav-Tiwari merged 2 commits intoJul 20, 2026
Merged
Conversation
CLI telemetry had no rate limiting, so agent hooks and scripts polling commands like ao status/ao session ls in loops drove a runaway PostHog bill. ao.cli.invoked now caps at once per command path per day and ao.app.active at once per day; both hooks/pty-host stay counted (not excluded) so headless installs don't silently drop out of DAU. Events bill as anonymous instead of identified since our distinct id is a random install id, not a person. Usage-error telemetry no longer leaks raw CLI args. Adds a shared burst-plus-daily rate ceiling per event name for everything else that had no cap at all (http 5xx, panics, renderer events/exceptions), so a crash loop or retry loop can't repeat this. Bursty daemon events (5xx, panics, usage errors) are aggregated into one rollup per minute with a real count instead of being rate-limited away, so a 6-error blip and a 10,000-error storm are still distinguishable in PostHog, at a fraction of the event cost.
laxmanclo
force-pushed
the
fix/telemetry-rate-limits
branch
from
July 20, 2026 05:42
35db475 to
0222150
Compare
Vaibhaav-Tiwari
requested changes
Jul 20, 2026
Vaibhaav-Tiwari
left a comment
Collaborator
There was a problem hiding this comment.
just resolved the conflicts else looks good
golangci-lint (revive) requires exported-type doc comments to begin with the type name.
Vaibhaav-Tiwari
approved these changes
Jul 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CLI telemetry counted every invocation uncapped, and a few other events
(http errors, panics, generic renderer events) had no ceiling either.
This caps everything at the point it leaves the machine: CLI commands
report at most once per command per day (so polling loops become "used
today" instead of one event per call), events that need an actual count
(errors, crashes), and events bill as anonymous instead of identified since
our distinct id is just a random install id, not a person. Apart from that events like errors etc. are aggregated and have generous rate limits.