Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "feat(server): Org rate limit per metric bucket" #2821

Merged
merged 1 commit into from
Dec 6, 2023
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
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## Unreleased

Check failure on line 3 in CHANGELOG.md

View workflow job for this annotation

GitHub Actions / Changelogs

Missing changelog entry.

Please consider adding a changelog entry for the next release.

**Features**:

Expand All @@ -23,7 +23,6 @@
- Temporarily add metric summaries on spans and top-level transaction events to link DDM with performance monitoring. ([#2757](https://github.com/getsentry/relay/pull/2757))
- Add size limits on metric related envelope items. ([#2800](https://github.com/getsentry/relay/pull/2800))
- Include the size offending item in the size limit error message. ([#2801](https://github.com/getsentry/relay/pull/2801))
- Org rate limit metrics per bucket. ([#2758](https://github.com/getsentry/relay/pull/2758))

## 23.11.2

Expand Down
1 change: 0 additions & 1 deletion py/sentry_relay/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class DataCategory(IntEnum):
SPAN = 12
MONITOR_SEAT = 13
USER_REPORT_V2 = 14
METRIC_BUCKET = 15
UNKNOWN = -1
# end generated

Expand Down
4 changes: 0 additions & 4 deletions relay-base-schema/src/data_category.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ pub enum DataCategory {
/// Currently standardized on name UserReportV2 to avoid clashing with the old UserReport.
/// TODO(jferg): Rename this to UserFeedback once old UserReport is deprecated.
UserReportV2 = 14,
/// Metric bucket.
MetricBucket = 15,
//
// 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 @@ -95,7 +93,6 @@ impl DataCategory {
"span" => Self::Span,
"monitor_seat" => Self::MonitorSeat,
"feedback" => Self::UserReportV2,
"metric_bucket" => Self::MetricBucket,
_ => Self::Unknown,
}
}
Expand All @@ -119,7 +116,6 @@ impl DataCategory {
Self::Span => "span",
Self::MonitorSeat => "monitor_seat",
Self::UserReportV2 => "feedback",
Self::MetricBucket => "metric_bucket",
Self::Unknown => "unknown",
}
}
Expand Down
28 changes: 16 additions & 12 deletions relay-cabi/include/relay.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
/**
* Classifies the type of data that is being ingested.
*/
enum RelayDataCategory {
enum RelayDataCategory
{
/**
* Reserved and unused.
*/
Expand Down Expand Up @@ -96,10 +97,6 @@ enum RelayDataCategory {
* TODO(jferg): Rename this to UserFeedback once old UserReport is deprecated.
*/
RELAY_DATA_CATEGORY_USER_REPORT_V2 = 14,
/**
* Metric bucket.
*/
RELAY_DATA_CATEGORY_METRIC_BUCKET = 15,
/**
* Any other data category not known by this Relay.
*/
Expand All @@ -110,7 +107,8 @@ typedef int8_t RelayDataCategory;
/**
* Controls the globbing behaviors.
*/
enum GlobFlags {
enum GlobFlags
{
/**
* When enabled `**` matches over path separators and `*` does not.
*/
Expand All @@ -133,7 +131,8 @@ typedef uint32_t GlobFlags;
/**
* Represents all possible error codes.
*/
enum RelayErrorCode {
enum RelayErrorCode
{
RELAY_ERROR_CODE_NO_ERROR = 0,
RELAY_ERROR_CODE_PANIC = 1,
RELAY_ERROR_CODE_UNKNOWN = 2,
Expand All @@ -158,7 +157,8 @@ typedef uint32_t RelayErrorCode;
* Values from <https://github.com/open-telemetry/opentelemetry-specification/blob/8fb6c14e4709e75a9aaa64b0dbbdf02a6067682a/specification/api-tracing.md#status>
* Mapping to HTTP from <https://github.com/open-telemetry/opentelemetry-specification/blob/8fb6c14e4709e75a9aaa64b0dbbdf02a6067682a/specification/data-http.md#status>
*/
enum RelaySpanStatus {
enum RelaySpanStatus
{
/**
* The operation completed successfully.
*
Expand Down Expand Up @@ -283,7 +283,8 @@ typedef struct RelayStoreNormalizer RelayStoreNormalizer;
* - When obtained as instance through return values, always free the string.
* - When obtained as pointer through field access, never free the string.
*/
typedef struct RelayStr {
typedef struct RelayStr
{
/**
* Pointer to the UTF-8 encoded string data.
*/
Expand All @@ -307,7 +308,8 @@ typedef struct RelayStr {
* - When obtained as instance through return values, always free the buffer.
* - When obtained as pointer through field access, never free the buffer.
*/
typedef struct RelayBuf {
typedef struct RelayBuf
{
/**
* Pointer to the raw data.
*/
Expand All @@ -325,7 +327,8 @@ typedef struct RelayBuf {
/**
* Represents a key pair from key generation.
*/
typedef struct RelayKeyPair {
typedef struct RelayKeyPair
{
/**
* The public key used for verifying Relay signatures.
*/
Expand All @@ -339,7 +342,8 @@ typedef struct RelayKeyPair {
/**
* A 16-byte UUID.
*/
typedef struct RelayUuid {
typedef struct RelayUuid
{
/**
* UUID bytes in network byte order (big endian).
*/
Expand Down
11 changes: 6 additions & 5 deletions relay-quotas/src/quota.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ impl CategoryUnit {
| DataCategory::Span
| DataCategory::MonitorSeat
| DataCategory::Monitor
| DataCategory::MetricBucket
| DataCategory::UserReportV2 => Some(Self::Count),
DataCategory::Attachment => Some(Self::Bytes),
DataCategory::Session => Some(Self::Batched),
Expand Down Expand Up @@ -296,14 +295,16 @@ impl Quota {
// Check for a scope identifier constraint. If there is no constraint, this means that the
// quota matches any scope. In case the scope is unknown, it will be coerced to the most
// specific scope later.
let Some(scope_id) = self.scope_id.as_ref() else {
return true;
let scope_id = match self.scope_id {
Some(ref scope_id) => scope_id,
None => return true,
};

// Check if the scope identifier in the quota is parseable. If not, this means we cannot
// fulfill the constraint, so the quota does not match.
let Ok(parsed) = scope_id.parse::<u64>() else {
return false;
let parsed = match scope_id.parse::<u64>() {
Ok(parsed) => parsed,
Err(_) => return false,
};

// At this stage, require that the scope is known since we have to fulfill the constraint.
Expand Down
Loading
Loading