sentry-react-native icon indicating copy to clipboard operation
sentry-react-native copied to clipboard

Add Release as default tag to Sentry Metrics

Open daniel-johns-99 opened this issue 1 year ago • 4 comments

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.

daniel-johns-99 avatar Apr 29 '24 15:04 daniel-johns-99

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/

krystofwoldrich avatar Apr 30 '24 11:04 krystofwoldrich

@daniel-johns-99 Are you currently adding the release tag manually?

krystofwoldrich avatar Apr 30 '24 11:04 krystofwoldrich

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 avatar Apr 30 '24 11:04 daniel-johns-99

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

krystofwoldrich avatar May 02 '24 14:05 krystofwoldrich

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 🙇

antonis avatar Nov 18 '24 11:11 antonis