isSpanMetricAlert.tsx 406 B

123456789101112
  1. import {isExtractedCustomMetric, isMRI, parseField} from 'sentry/utils/metrics/mri';
  2. /**
  3. * Currently we can tell if an alert is a span metric alert by checking the aggregate for an MRI
  4. */
  5. export function isSpanMetricAlert(aggregate?: string): boolean {
  6. if (!aggregate) {
  7. return false;
  8. }
  9. const mri = parseField(aggregate)?.mri;
  10. return !!mri && isMRI(mri) && isExtractedCustomMetric({mri});
  11. }