Conversation
Poll gauges, time gauges, long task timers, and function counters on a configurable interval while forwarding values through the existing Sentry metrics pipeline. Support disabled polling, isolate callback failures, and stop the polling worker when the registry closes. Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
|
📲 Install BuildsAndroid
|
This was referenced Sep 15, 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.
PR Stack (Micrometer)
📜 Description
Add fixed-rate polling for passive Micrometer meters to
SentryMeterRegistry.The registry polls gauges, time gauges, long-task timers, and function counters every 60 seconds by default. Applications can configure the interval in milliseconds or set it to zero to disable passive polling. Function counters emit positive deltas and reset their baseline when their source value decreases.
Polling resolves the active Sentry scopes at capture time, isolates callback failures between meters, skips non-finite values, and shuts down without blocking when the registry closes.
💡 Motivation and Context
Passive meters expose values through callbacks rather than record-time operations, so they cannot use the immediate forwarding added in the previous stack PR. A single registry-owned polling worker captures those values while continuing to use Sentry's existing metrics batching and transport.
FunctionTimeris intentionally deferred to the next PR because its cumulative count and total-time semantics need separate review.💚 How did you test it?
Tests cover each passive meter mapping, polling intervals, disabled polling, function-counter baselines and resets, callback isolation, dynamic scope resolution, meter removal, and shutdown.
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Add separately reviewed
FunctionTimerpolling semantics in the next stack PR.#skip-changelog