Skip to content

Commit

Permalink
ref(metrics): Change MetricHour data category to MetricSecond (#3558)
Browse files Browse the repository at this point in the history
A new DataCategory for METRIC_HOUR was added in
[#3384](#3384) that revenue will
use in future outcomes consumer that summarizes metric usage. It was
determined that we will be storing usage based on second buckets instead
of hour buckets, so we are updating the data category to reflect that.

The data category is not being used in sentry/getsentry yet.

Relevant tech specs:


https://www.notion.so/sentry/Metric-Hour-Pricing-2817cfeb664b47418bc82b397638b75c

https://www.notion.so/sentry/Billing-for-Metrics-552b2f6dcf9b4bb48ae7732afd14ddc3
  • Loading branch information
mbauer404 committed May 7, 2024
1 parent b06b856 commit 111f6c8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions py/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased

- Update data category metirc hours to metric seconds. [#3558](https://github.com/getsentry/relay/pull/3558)

## 0.8.60

- Expose project config normalization. Drop support for `validate_project_config`. ([#3495](https://github.com/getsentry/relay/pull/3495))
Expand All @@ -15,7 +19,7 @@

## 0.8.57

- Add a data category for metirc hours. [#3384](https://github.com/getsentry/relay/pull/3384)
- Add a data category for metirc hours. [#3384](https://github.com/getsentry/relay/pull/3384)

## 0.8.56

Expand Down Expand Up @@ -68,7 +72,6 @@

- Add ability to block metrics matching a glob pattern. ([#2954](https://github.com/getsentry/relay/pull/2954))


## 0.8.43

- Fix JSON capitalization for cardinality config. ([#2979](https://github.com/getsentry/relay/pull/2979))
Expand Down Expand Up @@ -158,11 +161,8 @@ This release requires Python 3.8 or later.
- Add filter based on transaction names. ([#2118](https://github.com/getsentry/relay/pull/2118))
- Add `lock` attribute to the frame protocol. ([#2171](https://github.com/getsentry/relay/pull/2171))


## 0.8.25



## 0.8.24

- Compile regexes in PII config validation. ([#2152](https://github.com/getsentry/relay/pull/2152))
Expand Down
2 changes: 1 addition & 1 deletion py/sentry_relay/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class DataCategory(IntEnum):
SPAN_INDEXED = 16
PROFILE_DURATION = 17
PROFILE_CHUNK = 18
METRIC_HOUR = 19
METRIC_SECOND = 19
UNKNOWN = -1
# end generated

Expand Down
8 changes: 4 additions & 4 deletions relay-base-schema/src/data_category.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ pub enum DataCategory {
/// 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,
/// MetricHour
/// MetricSecond
///
/// Reserved by billing to summarize the bucketed product of metric volume
/// and metric cardinality. Defined here so as not to clash with future
/// categories.
MetricHour = 19,
MetricSecond = 19,
//
// 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 @@ -118,7 +118,7 @@ impl DataCategory {
"span_indexed" => Self::SpanIndexed,
"profile_duration" => Self::ProfileDuration,
"profile_chunk" => Self::ProfileChunk,
"metric_hour" => Self::MetricHour,
"metric_second" => Self::MetricSecond,
_ => Self::Unknown,
}
}
Expand Down Expand Up @@ -146,7 +146,7 @@ impl DataCategory {
Self::SpanIndexed => "span_indexed",
Self::ProfileDuration => "profile_duration",
Self::ProfileChunk => "profile_chunk",
Self::MetricHour => "metric_hour",
Self::MetricSecond => "metric_second",
Self::Unknown => "unknown",
}
}
Expand Down
4 changes: 2 additions & 2 deletions relay-cabi/include/relay.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@ enum RelayDataCategory {
*/
RELAY_DATA_CATEGORY_PROFILE_CHUNK = 18,
/**
* MetricHour
* MetricSecond
*
* Reserved by billing to summarize the bucketed product of metric volume
* and metric cardinality. Defined here so as not to clash with future
* categories.
*/
RELAY_DATA_CATEGORY_METRIC_HOUR = 19,
RELAY_DATA_CATEGORY_METRIC_SECOND = 19,
/**
* Any other data category not known by this Relay.
*/
Expand Down
2 changes: 1 addition & 1 deletion relay-quotas/src/quota.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ impl CategoryUnit {
| DataCategory::MetricBucket
| DataCategory::UserReportV2
| DataCategory::ProfileChunk
| DataCategory::MetricHour => Some(Self::Count),
| DataCategory::MetricSecond => Some(Self::Count),
DataCategory::Attachment => Some(Self::Bytes),
DataCategory::Session => Some(Self::Batched),
DataCategory::ProfileDuration => Some(Self::Milliseconds),
Expand Down

0 comments on commit 111f6c8

Please sign in to comment.