Skip to content

Commit

Permalink
feat(replays): Add video entry to DataCategory enum (#3847)
Browse files Browse the repository at this point in the history
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: getsentry/team-replay#452
  • Loading branch information
cmanallen committed Jul 23, 2024
1 parent 3f03ac2 commit a2ccf08
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions py/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
1 change: 1 addition & 0 deletions py/sentry_relay/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class DataCategory(IntEnum):
PROFILE_DURATION = 17
PROFILE_CHUNK = 18
METRIC_SECOND = 19
REPLAY_VIDEO = 20
UNKNOWN = -1
# end generated

Expand Down
6 changes: 6 additions & 0 deletions relay-base-schema/src/data_category.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -119,6 +123,7 @@ impl DataCategory {
"profile_duration" => Self::ProfileDuration,
"profile_chunk" => Self::ProfileChunk,
"metric_second" => Self::MetricSecond,
"replay_video" => Self::MetricSecond,
_ => Self::Unknown,
}
}
Expand Down Expand Up @@ -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",
}
}
Expand Down
12 changes: 7 additions & 5 deletions relay-cabi/include/relay.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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);

Expand Down
1 change: 1 addition & 0 deletions relay-quotas/src/quota.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ impl CategoryUnit {
| DataCategory::Error
| DataCategory::Transaction
| DataCategory::Replay
| DataCategory::ReplayVideo
| DataCategory::Security
| DataCategory::Profile
| DataCategory::ProfileIndexed
Expand Down

0 comments on commit a2ccf08

Please sign in to comment.