Skip to content

Commit

Permalink
feat(profiles): Add a new category to count profile chunks (#3303)
Browse files Browse the repository at this point in the history
  • Loading branch information
phacops authored Mar 21, 2024
1 parent 5d448e3 commit 36ce651
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
**Internal**:

- Enable `db.redis` span metrics extraction. ([#3283](https://github.com/getsentry/relay/pull/3283))
- Add a data category for continuous profiling. ([#3284](https://github.com/getsentry/relay/pull/3284))
- Add data categories for continuous profiling. ([#3284](https://github.com/getsentry/relay/pull/3284), [#3303](https://github.com/getsentry/relay/pull/3303))
- Apply rate limits to span metrics. ([#3255](https://github.com/getsentry/relay/pull/3255))
- Extract metrics from transaction spans. ([#3273](https://github.com/getsentry/relay/pull/3273))
- Implement volume metric stats. ([#3281](https://github.com/getsentry/relay/pull/3281))
Expand Down
6 changes: 5 additions & 1 deletion py/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Changelog

## Unreleased

- Add a data category for profile chunks. [#3303](https://github.com/getsentry/relay/pull/3303))

## 0.8.52

- Add a data category for continuous profiling. ([#3284](https://github.com/getsentry/relay/pull/3284))
- Add a data category for profile duration. ([#3284](https://github.com/getsentry/relay/pull/3284))

## 0.8.50

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 @@ -27,6 +27,7 @@ class DataCategory(IntEnum):
METRIC_BUCKET = 15
SPAN_INDEXED = 16
PROFILE_DURATION = 17
PROFILE_CHUNK = 18
UNKNOWN = -1
# end generated

Expand Down
7 changes: 7 additions & 0 deletions relay-base-schema/src/data_category.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ pub enum DataCategory {
/// This data category is used to count the number of milliseconds we have per indexed profile chunk.
/// We will then bill per second.
ProfileDuration = 17,
/// ProfileChunk
///
/// This is a count of profile chunks received. It will not be used for billing but will be
/// useful for customers to track what's being dropped.
ProfileChunk = 18,
//
// 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 @@ -107,6 +112,7 @@ impl DataCategory {
"metric_bucket" => Self::MetricBucket,
"span_indexed" => Self::SpanIndexed,
"profile_duration" => Self::ProfileDuration,
"profile_chunk" => Self::ProfileChunk,
_ => Self::Unknown,
}
}
Expand All @@ -133,6 +139,7 @@ impl DataCategory {
Self::MetricBucket => "metric_bucket",
Self::SpanIndexed => "span_indexed",
Self::ProfileDuration => "profile_duration",
Self::ProfileChunk => "profile_chunk",
Self::Unknown => "unknown",
}
}
Expand Down
7 changes: 7 additions & 0 deletions relay-cabi/include/relay.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@ enum RelayDataCategory {
* We will then bill per second.
*/
RELAY_DATA_CATEGORY_PROFILE_DURATION = 17,
/**
* ProfileChunk
*
* This is a count of profile chunks received. It will not be used for billing but will be
* useful for customers to track what's being dropped.
*/
RELAY_DATA_CATEGORY_PROFILE_CHUNK = 18,
/**
* Any other data category not known by this Relay.
*/
Expand Down
3 changes: 2 additions & 1 deletion relay-quotas/src/quota.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ impl CategoryUnit {
| DataCategory::MonitorSeat
| DataCategory::Monitor
| DataCategory::MetricBucket
| DataCategory::UserReportV2 => Some(Self::Count),
| DataCategory::UserReportV2
| DataCategory::ProfileChunk => Some(Self::Count),
DataCategory::Attachment => Some(Self::Bytes),
DataCategory::Session => Some(Self::Batched),
DataCategory::ProfileDuration => Some(Self::Milliseconds),
Expand Down

0 comments on commit 36ce651

Please sign in to comment.