Skip to content

ref(metrics): Promote metrics capture API - #6425

Open
adinauer wants to merge 2 commits into
9.x.xfrom
ref/promote-metrics-capture-api-v9
Open

adinauer wants to merge 2 commits into
9.x.xfrom
ref/promote-metrics-capture-api-v9

Conversation

@adinauer

@adinauer adinauer commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

📜 Description

Remove @ApiStatus.Experimental from SentryClient.captureMetric(...).

The corresponding ISentryClient method and high-level Application Metrics API are already stable. Batched transport and processor plumbing remain internal. This changes API status only; metric capture behavior remains unchanged.

💡 Motivation and Context

The Application Metrics API already provides stable counters, gauges, distributions, units, attributes, scope association, and beforeSendMetric. The annotation on the concrete client implementation is inconsistent with the stable interface and public API.

High-volume buffering and accumulation improvements tracked in #6150 and #6151 can be implemented behind the existing capture API.

Refs #6408

💚 How did you test it?

Ran:

./gradlew spotlessApply apiDump
./gradlew :sentry:test --tests io.sentry.SentryClientTest --tests io.sentry.metrics.MetricsBatchProcessorTest

Both commands completed successfully, and API generation produced no API dump changes.

📝 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

Improve high-volume buffering and metric accumulation separately without changing the public metrics API.

adinauer and others added 2 commits October 30, 2026 10:22
Remove the remaining experimental annotation from SentryClient.captureMetric. The interface and high-level metrics API are already stable, while buffering and accumulation can continue evolving internally.

Refs #6408
Refs #6150
Refs #6151
Co-Authored-By: Claude <noreply@anthropic.com>
@sentry

sentry Bot commented Oct 30, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

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

⚙️ sentry-android Build Distribution Settings

@adinauer
adinauer marked this pull request as ready for review October 30, 2026 09:34

This branch has not been deployed

No deployments
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.

2 participants