Skip to content

feat(micrometer): [Micrometer 3] Add function timer polling - #6115

Draft
adinauer wants to merge 1 commit into
feat/micrometer-passive-pollingfrom
feat/micrometer-function-timer
Draft

adinauer wants to merge 1 commit into
feat/micrometer-passive-pollingfrom
feat/micrometer-function-timer

Conversation

@adinauer

@adinauer adinauer commented Sep 15, 2026

Copy link
Copy Markdown
Member

PR Stack (Micrometer)


📜 Description

Add passive polling for Micrometer FunctionTimer meters.

Each function timer emits positive changes in its cumulative count and total time as <name>.count and <name>.total_time Sentry counters. The implementation establishes an initial baseline, handles source resets, skips invalid values, and resets its state when the meter is removed.

💡 Motivation and Context

Micrometer function timers expose cumulative count and total-time callbacks. Those values cannot reconstruct the original observations needed for a Sentry distribution or a meaningful per-instance mean, so this PR preserves their representable semantics as independent counter deltas.

Keeping this mapping separate makes the semantic tradeoff explicit and reviewable.

💚 How did you test it?

./gradlew spotlessApply apiDump
./gradlew :sentry-micrometer:check

Tests cover baselines, positive deltas, count-only and time-only changes, resets, non-finite and negative values, meter removal, units, tags, and callback failures.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

Add opt-in Spring Boot 2, 3, and 4 integration in the final stack PR.

#skip-changelog

⚠️ Merge this PR using a merge commit (not squash). Only the collection branch is squash-merged into main.

Export function timer count and total-time changes as independent positive
counter deltas while preserving reset and invalid-value semantics.

Keep timer aggregation correct across instances by avoiding synthetic means
and distributions that Micrometer's cumulative values cannot represent.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 60643e8

@sentry

sentry Bot commented Sep 15, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.56.0 (1) release

⚙️ sentry-android Build Distribution Settings

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