From a2ccf08b946d111faa6777be89083f30bc70e4df Mon Sep 17 00:00:00 2001 From: Colton Allen Date: Tue, 23 Jul 2024 11:40:47 -0500 Subject: [PATCH] feat(replays): Add video entry to DataCategory enum (#3847) During the beta period we're not emitting accepted replay outcomes for mobile replays (to prevent customer's from being billed). Tracking usage through Looker is difficult without this data. We want to emit a non-billed outcome in our consumer for tracking purposes. This category is assumed to be temporary. Related: https://github.com/getsentry/team-replay/issues/452 --- CHANGELOG.md | 1 + py/CHANGELOG.md | 4 ++++ py/sentry_relay/consts.py | 1 + relay-base-schema/src/data_category.rs | 6 ++++++ relay-cabi/include/relay.h | 12 +++++++----- relay-quotas/src/quota.rs | 1 + 6 files changed, 20 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a5b86084a..391f1a379f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - Use a dedicated thread pool for CPU intensive workloads. ([#3833](https://github.com/getsentry/relay/pull/3833)) - Remove `BufferGuard` in favor of memory checks via `MemoryStat`. ([#3821](https://github.com/getsentry/relay/pull/3821)) +- Add ReplayVideo entry to DataCategory. ([#3847](https://github.com/getsentry/relay/pull/3847)) ## 24.7.0 diff --git a/py/CHANGELOG.md b/py/CHANGELOG.md index e55d54e667..3a904962aa 100644 --- a/py/CHANGELOG.md +++ b/py/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Unreleased + +- Add REPLAY_VIDEO entry to DataCategory. ([#3847](https://github.com/getsentry/relay/pull/3847)) + ## 0.9.0 - Build wheels with manylinux_2_28 and alma linux 8. [#3787](https://github.com/getsentry/relay/pull/3787) diff --git a/py/sentry_relay/consts.py b/py/sentry_relay/consts.py index 6ff62d5f45..73a4e8ea74 100644 --- a/py/sentry_relay/consts.py +++ b/py/sentry_relay/consts.py @@ -29,6 +29,7 @@ class DataCategory(IntEnum): PROFILE_DURATION = 17 PROFILE_CHUNK = 18 METRIC_SECOND = 19 + REPLAY_VIDEO = 20 UNKNOWN = -1 # end generated diff --git a/relay-base-schema/src/data_category.rs b/relay-base-schema/src/data_category.rs index 35840ca19a..62498cc421 100644 --- a/relay-base-schema/src/data_category.rs +++ b/relay-base-schema/src/data_category.rs @@ -84,6 +84,10 @@ pub enum DataCategory { /// and metric cardinality. Defined here so as not to clash with future /// categories. MetricSecond = 19, + /// Replay Video + /// + /// This is the data category for Session Replays produced via a video recording. + ReplayVideo = 20, // // 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. @@ -119,6 +123,7 @@ impl DataCategory { "profile_duration" => Self::ProfileDuration, "profile_chunk" => Self::ProfileChunk, "metric_second" => Self::MetricSecond, + "replay_video" => Self::MetricSecond, _ => Self::Unknown, } } @@ -147,6 +152,7 @@ impl DataCategory { Self::ProfileDuration => "profile_duration", Self::ProfileChunk => "profile_chunk", Self::MetricSecond => "metric_second", + Self::ReplayVideo => "replay_video", Self::Unknown => "unknown", } } diff --git a/relay-cabi/include/relay.h b/relay-cabi/include/relay.h index 6e8359d9c1..318b293950 100644 --- a/relay-cabi/include/relay.h +++ b/relay-cabi/include/relay.h @@ -128,6 +128,12 @@ enum RelayDataCategory { * categories. */ RELAY_DATA_CATEGORY_METRIC_SECOND = 19, + /** + * Replay Video + * + * This is the data category for Session Replays produced via a video recording. + */ + RELAY_DATA_CATEGORY_REPLAY_VIDEO = 20, /** * Any other data category not known by this Relay. */ @@ -652,15 +658,11 @@ struct RelayStr relay_validate_sampling_configuration(const struct RelayStr *val /** * Normalize a project config. - * - * If `strict` is true, checks for unknown fields in the input. */ struct RelayStr relay_normalize_project_config(const struct RelayStr *value); /** - * Validate cardinality limit config. - * - * If `strict` is true, checks for unknown fields in the input. + * Normalize a cardinality limit config. */ struct RelayStr normalize_cardinality_limit_config(const struct RelayStr *value); diff --git a/relay-quotas/src/quota.rs b/relay-quotas/src/quota.rs index fc3783c7a0..a49acffb2a 100644 --- a/relay-quotas/src/quota.rs +++ b/relay-quotas/src/quota.rs @@ -183,6 +183,7 @@ impl CategoryUnit { | DataCategory::Error | DataCategory::Transaction | DataCategory::Replay + | DataCategory::ReplayVideo | DataCategory::Security | DataCategory::Profile | DataCategory::ProfileIndexed