diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bedc274964..5f424a03100 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ - Produce Span V2 Kafka messages. ([#5151](https://github.com/getsentry/relay/pull/5151), [#5173](https://github.com/getsentry/relay/pull/5173), [#5199](https://github.com/getsentry/relay/pull/5199)) - Extract additional `user.geo.*` attributes on spans. ([#5194](https://github.com/getsentry/relay/pull/5194)) - Modernize session processing and move to Relay's new processing framework. ([#5201](https://github.com/getsentry/relay/pull/5201)) +- Add TraceMetric data category. ([#5206](https://github.com/getsentry/relay/pull/5206)) ## 25.9.0 diff --git a/py/CHANGELOG.md b/py/CHANGELOG.md index 3329b9fa556..c0abf8c89cb 100644 --- a/py/CHANGELOG.md +++ b/py/CHANGELOG.md @@ -6,6 +6,7 @@ - Add InstallableBuild and SizeAnalysis data categories. ([#5084](https://github.com/getsentry/relay/pull/5084)) - Add `retentions` to the project configuration. ([#5135](https://github.com/getsentry/relay/pull/5135)) - Normalization: Trim event tag keys & values to 200 chars instead of dropping them. ([#5198](https://github.com/getsentry/relay/pull/5198)) +- Add TraceMetric data category. ([#5206](https://github.com/getsentry/relay/pull/5206)) ## 0.9.16 diff --git a/py/sentry_relay/consts.py b/py/sentry_relay/consts.py index 76dfeb110fc..d01dff5dd74 100644 --- a/py/sentry_relay/consts.py +++ b/py/sentry_relay/consts.py @@ -43,6 +43,7 @@ class DataCategory(IntEnum): PREVENT_REVIEW = 30 SIZE_ANALYSIS = 31 INSTALLABLE_BUILD = 32 + TRACE_METRIC = 33 UNKNOWN = -1 # end generated diff --git a/relay-base-schema/src/data_category.rs b/relay-base-schema/src/data_category.rs index 86b4b2b2143..53c3fd80a51 100644 --- a/relay-base-schema/src/data_category.rs +++ b/relay-base-schema/src/data_category.rs @@ -146,6 +146,10 @@ pub enum DataCategory { /// artifacts are downloaded for installation. /// When enabled there will typically be one 'InstallableBuild' per uploaded artifact. InstallableBuild = 32, + /// TraceMetric + /// + /// This is the data category to count the number of trace metric items. + TraceMetric = 33, // // IMPORTANT: After adding a new entry to DataCategory, go to the `relay-cabi` subfolder and run // `make header` to regenerate the C-binding. This allows using the data category from Python. @@ -195,6 +199,7 @@ impl DataCategory { "prevent_review" => Self::PreventReview, "size_analysis" => Self::SizeAnalysis, "installable_build" => Self::InstallableBuild, + "trace_metric" => Self::TraceMetric, _ => Self::Unknown, } } @@ -236,6 +241,7 @@ impl DataCategory { Self::PreventReview => "prevent_review", Self::SizeAnalysis => "size_analysis", Self::InstallableBuild => "installable_build", + Self::TraceMetric => "trace_metric", Self::Unknown => "unknown", } } @@ -338,6 +344,7 @@ impl TryFrom for DataCategory { 30 => Ok(Self::PreventReview), 31 => Ok(Self::SizeAnalysis), 32 => Ok(Self::InstallableBuild), + 33 => Ok(Self::TraceMetric), other => Err(UnknownDataCategory(other)), } } @@ -352,10 +359,7 @@ mod tests { // If this test fails, update the numeric bounds so that the first assertion // maps to the last variant in the enum and the second assertion produces an error // that the DataCategory does not exist. - assert_eq!( - DataCategory::try_from(32), - Ok(DataCategory::InstallableBuild) - ); - assert_eq!(DataCategory::try_from(33), Err(UnknownDataCategory(33))); + assert_eq!(DataCategory::try_from(33), Ok(DataCategory::TraceMetric)); + assert_eq!(DataCategory::try_from(34), Err(UnknownDataCategory(34))); } } diff --git a/relay-cabi/include/relay.h b/relay-cabi/include/relay.h index 05540771902..222021b7da7 100644 --- a/relay-cabi/include/relay.h +++ b/relay-cabi/include/relay.h @@ -211,6 +211,12 @@ enum RelayDataCategory { * When enabled there will typically be one 'InstallableBuild' per uploaded artifact. */ RELAY_DATA_CATEGORY_INSTALLABLE_BUILD = 32, + /** + * TraceMetric + * + * This is the data category to count the number of trace metric items. + */ + RELAY_DATA_CATEGORY_TRACE_METRIC = 33, /** * Any other data category not known by this Relay. */ diff --git a/relay-quotas/src/quota.rs b/relay-quotas/src/quota.rs index f4c35fffde8..dad3d279bb3 100644 --- a/relay-quotas/src/quota.rs +++ b/relay-quotas/src/quota.rs @@ -216,7 +216,8 @@ impl CategoryUnit { | DataCategory::PreventReview | DataCategory::Session | DataCategory::SizeAnalysis - | DataCategory::InstallableBuild => Some(Self::Count), + | DataCategory::InstallableBuild + | DataCategory::TraceMetric => Some(Self::Count), DataCategory::Attachment | DataCategory::LogByte => Some(Self::Bytes), DataCategory::ProfileDuration | DataCategory::ProfileDurationUi => { Some(Self::Milliseconds)