feat(envelope-item): Support metric type by lucas-zimerman ยท Pull Request #4956 ยท getsentry/sentry-java

๐Ÿ“œ Description

Metric support - this PR is needed for Capacitor/Dart/Flutter/React-Native right now but will be needed in general in the future when Java also implements Metric support

๐Ÿ’ก Motivation and Context

See metric protocol: https://develop.sentry.dev/sdk/telemetry/metrics/

Needed for processing envelope items with type trace_metric. Without this change, Hybrid SDKs will lose their metric data by replacing type trace_metric by __unknown__.

๐Ÿ’š How did you test it?

Unit test

๐Ÿ“ 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

Close #4957