Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

**Features**:

- Add InstallableBuild and SizeAnalysis data categories. ([#5084](https://github.com/getsentry/relay/pull/5084))

**Internal**:

- Disable PII scrubbing for gen ai operation name. ([#5064](https://github.com/getsentry/relay/pull/5064))
Expand Down
1 change: 1 addition & 0 deletions py/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Unreleased

- Introduces a project scope sampling rule type. ([#5077](https://github.com/getsentry/relay/pull/5077)))
- Add InstallableBuild and SizeAnalysis data categories. ([#5084](https://github.com/getsentry/relay/pull/5084))

## 0.9.13

Expand Down
3 changes: 3 additions & 0 deletions py/sentry_relay/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@


class DataCategory(IntEnum):
# See _check_generated below.
# begin generated
DEFAULT = 0
ERROR = 1
Expand Down Expand Up @@ -40,6 +41,8 @@ class DataCategory(IntEnum):
SEER_SCANNER = 28
PREVENT_USER = 29
PREVENT_REVIEW = 30
SIZE_ANALYSIS = 31
INSTALLABLE_BUILD = 32
UNKNOWN = -1
# end generated

Expand Down
27 changes: 25 additions & 2 deletions relay-base-schema/src/data_category.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,20 @@ pub enum DataCategory {
///
/// This is the data category to count the number of Prevent review events.
PreventReview = 30,
/// Size analysis
///
/// This is the data category to count the number of size analyses performed.
/// 'Size analysis' a static binary analysis of a preprod build artifact
/// (e.g. the .apk of an Android app or MacOS .app).
/// When enabled there will typically be one such analysis per uploaded artifact.
SizeAnalysis = 31,
/// InstallableBuild
///
/// This is the data category to count the number of installable builds.
/// It counts the number of artifacts uploaded *not* the number of times the
/// artifacts are downloaded for installation.
/// When enabled there will typically be one 'InstallableBuild' per uploaded artifact.
InstallableBuild = 32,
//
// 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 @@ -179,6 +193,8 @@ impl DataCategory {
"seer_scanner" => Self::SeerScanner,
"prevent_user" => Self::PreventUser,
"prevent_review" => Self::PreventReview,
"size_analysis" => Self::SizeAnalysis,
"installable_build" => Self::InstallableBuild,
_ => Self::Unknown,
}
}
Expand Down Expand Up @@ -218,6 +234,8 @@ impl DataCategory {
Self::SeerScanner => "seer_scanner",
Self::PreventUser => "prevent_user",
Self::PreventReview => "prevent_review",
Self::SizeAnalysis => "size_analysis",
Self::InstallableBuild => "installable_build",
Self::Unknown => "unknown",
}
}
Expand Down Expand Up @@ -318,6 +336,8 @@ impl TryFrom<u8> for DataCategory {
28 => Ok(Self::SeerScanner),
29 => Ok(Self::PreventUser),
30 => Ok(Self::PreventReview),
31 => Ok(Self::SizeAnalysis),
32 => Ok(Self::InstallableBuild),
other => Err(UnknownDataCategory(other)),
}
}
Expand All @@ -332,7 +352,10 @@ mod tests {
// If this test fails, update the numeric bounds so that the first assertion
// maps to the last variant in the enum and the second assertion produces an error
// that the DataCategory does not exist.
assert_eq!(DataCategory::try_from(30), Ok(DataCategory::PreventReview));
assert_eq!(DataCategory::try_from(31), Err(UnknownDataCategory(31)));
assert_eq!(
DataCategory::try_from(32),
Ok(DataCategory::InstallableBuild)
);
assert_eq!(DataCategory::try_from(33), Err(UnknownDataCategory(33)));
}
}
26 changes: 21 additions & 5 deletions relay-cabi/include/relay.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#ifndef RELAY_H_INCLUDED
#define RELAY_H_INCLUDED

/* Generated with cbindgen:0.28.0 */
/* Generated with cbindgen:0.29.0 */

/* Warning, this file is autogenerated. Do not modify this manually. */

Expand Down Expand Up @@ -174,13 +174,11 @@ enum RelayDataCategory {
*/
RELAY_DATA_CATEGORY_PROFILE_CHUNK_UI = 26,
/**
* Seer Autofix Run
*
* This is the data category to count Seer Autofix run events.
*/
RELAY_DATA_CATEGORY_SEER_AUTOFIX = 27,
/**
* Seer Scanner Run
*
* This is the data category to count Seer Scanner run events.
*/
RELAY_DATA_CATEGORY_SEER_SCANNER = 28,
/**
Expand All @@ -195,6 +193,24 @@ enum RelayDataCategory {
* This is the data category to count the number of Prevent review events.
*/
RELAY_DATA_CATEGORY_PREVENT_REVIEW = 30,
/**
* Size analysis
*
* This is the data category to count the number of size analyses performed.
* 'Size analysis' a static binary analysis of a preprod build artifact
* (e.g. the .apk of an Android app or MacOS .app).
* When enabled there will typically be one such analysis per uploaded artifact.
*/
RELAY_DATA_CATEGORY_SIZE_ANALYSIS = 31,
/**
* InstallableBuild
*
* This is the data category to count the number of installable builds.
* It counts the number of artifacts uploaded *not* the number of times the
* artifacts are downloaded for installation.
* When enabled there will typically be one 'InstallableBuild' per uploaded artifact.
*/
RELAY_DATA_CATEGORY_INSTALLABLE_BUILD = 32,
/**
* Any other data category not known by this Relay.
*/
Expand Down
4 changes: 3 additions & 1 deletion relay-quotas/src/quota.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ impl CategoryUnit {
| DataCategory::SeerScanner
| DataCategory::PreventUser
| DataCategory::PreventReview
| DataCategory::Session => Some(Self::Count),
| DataCategory::Session
| DataCategory::SizeAnalysis
| DataCategory::InstallableBuild => Some(Self::Count),
DataCategory::Attachment | DataCategory::LogByte => Some(Self::Bytes),
DataCategory::ProfileDuration | DataCategory::ProfileDurationUi => {
Some(Self::Milliseconds)
Expand Down
Loading