Skip to content

Conversation

@adinauer
Copy link
Member

@adinauer adinauer commented Dec 22, 2025

📜 Description

Add SentryMetricsEvents and SentryMetricsEvent transport types.

💡 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 4] Add transport types for metrics ([#4983](https://github.com/getsentry/sentry-java/pull/4983))

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 14ea96a

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public final class SentryMetricsEvents implements JsonUnknown, JsonSerializable {
Copy link
Member

Choose a reason for hiding this comment

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

Some serialization/deserialization tests for this would be nice.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added in #5005

@adinauer
Copy link
Member Author

cursor review

@adinauer
Copy link
Member Author

@sentry review


public final class SentryMetricsEvent implements JsonUnknown, JsonSerializable {

private @NotNull SentryId traceId;
Copy link

Choose a reason for hiding this comment

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

Missing getter for traceId field

Medium Severity

The traceId field in SentryMetricsEvent is declared but has no getter or setter methods. This is inconsistent with the spanId field in the same class which has both getSpanId() and setSpanId() accessors. Users implementing BeforeSendMetricCallback cannot programmatically access the trace ID of individual metrics events to inspect or filter them based on trace context.

Fix in Cursor Fix in Web

Base automatically changed from 12-17-enable_metrics_by_default to feat/trace-metrics January 14, 2026 09:24
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.

4 participants