Add FLAGS_EVALUATION metric#401
Draft
luismeyer wants to merge 2 commits into
Draft
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
b740436 to
7d29945
Compare
7d29945 to
5db1b2e
Compare
680bdf7 to
b74da47
Compare
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.
Adds aggregated flag-evaluation telemetry: a new
FLAGS_EVALUATIONingest event that buckets evaluations by flag/variant/reason/clientName and reports acountper bucket, alongside aclientNameoption for the Vercel Flags client. The usage tracker is refactored into dedicated event types (flags-config-read,flags-evaluation) with aBetterWeakMapfor per-request-context dedup, and the ingest path gains retry/aggregation handling.It also hardens batch flushing: the scheduled flush now awaits the full ingest send (incl. retries) so the
waitUntilpromise no longer resolves before in-flight batches complete, a 60s max flush window is added alongside the existing 5s idle window so batches still flush under continuous traffic, andshutdown()drains any pending flush instead of orphaning it. Repeated evaluations of the same bucket increment the aggregatedcountwithout counting toward the 50-event batch threshold. Covered by new black-box, scheduler, and usage-tracker tests; docs and changesets updated.🤖 Generated with Claude Code