Skip to content

Commit

Permalink
feat(outcomes): Add data category for attachment item count (#4374)
Browse files Browse the repository at this point in the history
  • Loading branch information
jjbayer authored Dec 12, 2024
1 parent e1524fc commit 775aa94
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 16 deletions.
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## Unreleased

**Bug Fixes**:

- Stop collecting the `has_profile` metrics tag & reporting outcomes for it. ([#4365](https://github.com/getsentry/relay/pull/4365))

**Features**:

- Add data categories for Uptime and Attachment Items. ([#4363](https://github.com/getsentry/relay/pull/4363), [#4374](https://github.com/getsentry/relay/pull/4374))

## 24.11.2

**Breaking Changes**:
Expand All @@ -12,7 +22,6 @@
- Accept incoming requests even if there was an error fetching their project config. ([#4140](https://github.com/getsentry/relay/pull/4140))
- Rate limit profiles when transaction was sampled. ([#4195](https://github.com/getsentry/relay/pull/4195))
- Fix scrubbing user paths in minidump debug module names. ([#4351](https://github.com/getsentry/relay/pull/4351))
- Stop collecting the `has_profile` metrics tag & reporting outcomes for it. ([#4365](https://github.com/getsentry/relay/pull/4365))
- Scrub user fields in span.sentry_tags. ([#4364](https://github.com/getsentry/relay/pull/4364)), ([#4370](https://github.com/getsentry/relay/pull/4370))

**Features**:
Expand All @@ -22,7 +31,6 @@

**Internal**:

- Adds the UPTIME DataCategory ([#4363](https://github.com/getsentry/relay/pull/4363))
- Promote some `span.data` fields to the top level. ([#4298](https://github.com/getsentry/relay/pull/4298))
- Remove metrics summaries. ([#4278](https://github.com/getsentry/relay/pull/4278), [#4279](https://github.com/getsentry/relay/pull/4279), [#4296](https://github.com/getsentry/relay/pull/4296))
- Use async `redis` for `projectconfig`. ([#4284](https://github.com/getsentry/relay/pull/4284))
Expand Down
4 changes: 2 additions & 2 deletions py/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

## Unreleased

**Breaking Changes**:
- Flatten Linux distribution fields into `os.context`([#4292](https://github.com/getsentry/relay/pull/4292))
- **Breaking**: Flatten Linux distribution fields into `os.context`([#4292](https://github.com/getsentry/relay/pull/4292))
- Add data categories for Uptime and Attachment Items. ([#4363](https://github.com/getsentry/relay/pull/4363), [#4374](https://github.com/getsentry/relay/pull/4374))

## 0.9.3

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 @@ -31,6 +31,7 @@ class DataCategory(IntEnum):
METRIC_SECOND = 19
REPLAY_VIDEO = 20
UPTIME = 21
ATTACHMENT_ITEM = 22
UNKNOWN = -1
# end generated

Expand Down
4 changes: 4 additions & 0 deletions relay-base-schema/src/data_category.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ pub enum DataCategory {
ReplayVideo = 20,
/// This is the data category for Uptime monitors.
Uptime = 21,
/// Counts the number of individual attachments, as opposed to the number of bytes in an attachment.
AttachmentItem = 22,
//
// 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 @@ -128,6 +130,7 @@ impl DataCategory {
"metric_second" => Self::MetricSecond,
"replay_video" => Self::ReplayVideo,
"uptime" => Self::Uptime,
"attachment_item" => Self::AttachmentItem,
_ => Self::Unknown,
}
}
Expand Down Expand Up @@ -158,6 +161,7 @@ impl DataCategory {
Self::MetricSecond => "metric_second",
Self::ReplayVideo => "replay_video",
Self::Uptime => "uptime",
Self::AttachmentItem => "attachment_item",
Self::Unknown => "unknown",
}
}
Expand Down
25 changes: 14 additions & 11 deletions relay-cabi/include/relay.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,13 @@ enum RelayDataCategory {
*/
RELAY_DATA_CATEGORY_REPLAY_VIDEO = 20,
/**
* Uptime Monitor
*
* This is the data category for Uptime monitors.
*/
RELAY_DATA_CATEGORY_UPTIME = 21,
/**
* Counts the number of individual attachments, as opposed to the number of bytes in an attachment.
*/
RELAY_DATA_CATEGORY_ATTACHMENT_ITEM = 22,
/**
* Any other data category not known by this Relay.
*/
Expand Down Expand Up @@ -552,6 +555,15 @@ struct RelayStr relay_err_get_backtrace(void);
*/
void relay_err_clear(void);

/**
* Performs a glob operation on bytes.
*
* Returns `true` if the glob matches, `false` otherwise.
*/
bool relay_is_glob_match(const struct RelayBuf *value,
const struct RelayStr *pat,
GlobFlags flags);

/**
* Chunks the given text based on remarks.
*/
Expand Down Expand Up @@ -627,15 +639,6 @@ struct RelayStr relay_pii_selector_suggestions_from_event(const struct RelayStr
*/
void relay_test_panic(void);

/**
* Performs a glob operation on bytes.
*
* Returns `true` if the glob matches, `false` otherwise.
*/
bool relay_is_glob_match(const struct RelayBuf *value,
const struct RelayStr *pat,
GlobFlags flags);

/**
* Parse a sentry release structure from a string.
*/
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 @@ -198,7 +198,8 @@ impl CategoryUnit {
| DataCategory::UserReportV2
| DataCategory::ProfileChunk
| DataCategory::Uptime
| DataCategory::MetricSecond => Some(Self::Count),
| DataCategory::MetricSecond
| DataCategory::AttachmentItem => Some(Self::Count),
DataCategory::Attachment => Some(Self::Bytes),
DataCategory::Session => Some(Self::Batched),
DataCategory::ProfileDuration => Some(Self::Milliseconds),
Expand Down

0 comments on commit 775aa94

Please sign in to comment.