Skip to content

Conversation

@adinauer
Copy link
Member

@adinauer adinauer commented Dec 22, 2025

📜 Description

Add a stubbed version of Metrics API to the SDK. Will be fleshed out in follow-up PRs.

💡 Motivation and Context

💚 How did you test it?

📝 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.

🔮 Next steps

Copy link
Member Author

adinauer commented Dec 22, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 22, 2025

Fails
🚫 Please consider adding a changelog entry for the next release.
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

### Features

- [Trace Metrics 2] MetricsApi stub ([#4981](https://github.com/getsentry/sentry-java/pull/4981))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against b0ec8eb

@github-actions
Copy link
Contributor

github-actions bot commented Dec 22, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 367.23 ms 439.31 ms 72.08 ms
Size 1.58 MiB 2.20 MiB 633.90 KiB


@Override
public void count(@NotNull String name) {
scopes.getOptions();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that will change anyway on on of the stacked PRs 😅

Suggested change
scopes.getOptions();
// TODO implement

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes 😄

@adinauer
Copy link
Member Author

@sentry review

Base automatically changed from 12-17-metrics_options to feat/trace-metrics January 14, 2026 09:09
@adinauer adinauer merged commit 1c96999 into feat/trace-metrics Jan 14, 2026
96 of 115 checks passed
@adinauer adinauer deleted the 12-17-metricsapi_stub branch January 14, 2026 09:12
adinauer added a commit that referenced this pull request Jan 14, 2026
* Metrics Options

* MetricsApi stub

* Add transport types for metrics

* Enable metrics by default

* Format code

* Add batch processor for Metrics

* Wire up Metrics parts

* Metrics counter basic API

* Metrics Count API

* Metrics Distribution API

* Metrics Gauge API

* Metrics Envelope item deserialization

* Record client report for discarded metrics envelope item

* Metrics external options

* Metrics Manifest options for Android

* Android Metrics batch processor and factory

* Only send user attributes if sendDefaultPii is true

* Remove Experimental Annotation from Metrics Options

* Add unit tests for Metrics

* Create SentryMetricsParameters for Metrics

* Use uv for managing python version

* fix

* Add device and OS attributes to metrics

* Add AI rules files for Metrics (and update feature flags rule)

* Close and flush MetricsBatchProcessor from SentryClient

* fix

* Add E2E tests for Metrics

* Final keyword in Metrics methods

* Add Hint to Metrics

* SentryMetricsParameters create shortcut for attributes map

* Automatically use SentryOptions.Metrics.BeforeSendMetricCallback Spring beans

* Rename sample API param, remove sleep

* Create MetricsUnit constants

* Format code

* Metrics Options (#4980)

* feat(metrics): [Trace Metrics 2] MetricsApi stub (#4981)

* Metrics Options

* MetricsApi stub

* More PR review changes (#5028)

* Some more PR review changes

* Format code

---------

Co-authored-by: Sentry Github Bot <bot+github-bot@sentry.io>

* changelog

* non nullable trace id

* error log now says metric instead of log

---------

Co-authored-by: Sentry Github Bot <bot+github-bot@sentry.io>
Co-authored-by: lcian <17258265+lcian@users.noreply.github.com>
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.

3 participants