Add Release as default tag to Sentry Metrics
The Sentry Metrics added on https://github.com/getsentry/sentry-react-native/pull/3590 are good, however it would be helpful for React Native by default to include the Release as a tag. Even if this is a plugin it would mean being able to leverage the same method Sentry uses to fetch the Release information.
Hi @daniel-johns-99, thank you for the suggestion, we will discuss this internally and keep you posted in here.
For completeness here is a code snipped ho tags can be added at the moment:
Sentry.metrics.increment("button_click", 1, {
tags: { browser: "Firefox", app_version: "1.0.0" },
});
https://docs.sentry.io/platforms/react-native/metrics/
@daniel-johns-99 Are you currently adding the release tag manually?
Hi @krystofwoldrich, yes we've had to create a auxilliary method to add the release as a tag. I think it would make sense for it to be there by default, given the release tag is a first class tag in quiet a few other parts of Sentry.
I released I commented on the wrong issue, but would you consider adding in a beforeEmit event as the SDK impl suggests where the release can be added into all metrics as a tag https://develop.sentry.dev/sdk/metrics/#hooks
@daniel-johns-99 Thank you for the reply, I can confirm adding the release tag by default, but we are going to add the beforeEmit hook which will make this much easier.
Closing since the metrics api was deprecated in JS (8.37.0) and will be removed with https://github.com/getsentry/sentry-react-native/pull/4278. Please reopen if needed 🙇