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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

- Calculate and track accepted bytes per individual trace metric item via `TraceMetricByte` data category. ([#5744](https://github.com/getsentry/relay/pull/5744), [#5767](https://github.com/getsentry/relay/pull/5767))
- Graduate standalone span ingestion feature flag. ([#5786](https://github.com/getsentry/relay/pull/5786))
- Remove cardinality limiter. ([#5809](https://github.com/getsentry/relay/pull/5809))
- Use new processor architecture to process standalone profiles. ([#5741](https://github.com/getsentry/relay/pull/5741))
- TUS: Disallow creation with upload. ([#5734](https://github.com/getsentry/relay/pull/5734))
- Add logic to verify attachment placeholders and correctly store them. ([#5747](https://github.com/getsentry/relay/pull/5747))
Expand Down
25 changes: 0 additions & 25 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4218,7 +4218,6 @@ dependencies = [
"regex",
"relay-auth",
"relay-base-schema",
"relay-cardinality",
"relay-common",
"relay-dynamic-config",
"relay-event-normalization",
Expand All @@ -4233,27 +4232,6 @@ dependencies = [
"uuid",
]

[[package]]
name = "relay-cardinality"
version = "26.3.1"
dependencies = [
"async-trait",
"criterion",
"hash32",
"hashbrown 0.15.4",
"parking_lot",
"relay-base-schema",
"relay-common",
"relay-log",
"relay-redis",
"relay-statsd",
"serde",
"serde_json",
"thiserror 2.0.17",
"tokio",
"uuid",
]

[[package]]
name = "relay-cogs"
version = "26.3.1"
Expand Down Expand Up @@ -4329,7 +4307,6 @@ dependencies = [
"anyhow",
"relay-auth",
"relay-base-schema",
"relay-cardinality",
"relay-common",
"relay-event-normalization",
"relay-filter",
Expand Down Expand Up @@ -4503,7 +4480,6 @@ dependencies = [
"priority-queue",
"rand 0.9.2",
"relay-base-schema",
"relay-cardinality",
"relay-cogs",
"relay-common",
"relay-log",
Expand Down Expand Up @@ -4801,7 +4777,6 @@ dependencies = [
"regex",
"relay-auth",
"relay-base-schema",
"relay-cardinality",
"relay-cogs",
"relay-common",
"relay-config",
Expand Down
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ unexpected_cfgs = { level = "warn", check-cfg = ['cfg(sentry)'] }
[workspace.dependencies]
relay-auth = { path = "relay-auth" }
relay-base-schema = { path = "relay-base-schema" }
relay-cardinality = { path = "relay-cardinality" }
relay-cogs = { path = "relay-cogs" }
relay-common = { path = "relay-common" }
relay-config = { path = "relay-config" }
Expand Down
29 changes: 0 additions & 29 deletions py/sentry_relay/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"validate_sampling_condition",
"validate_sampling_configuration",
"normalize_project_config",
"normalize_cardinality_limit_config",
"normalize_global_config",
]

Expand Down Expand Up @@ -327,34 +326,6 @@ def normalize_project_config(
raise ValueError(rv)


def normalize_cardinality_limit_config(
config,
json_dumps: Callable[[Any], Any] = json.dumps,
json_loads: Callable[[str | bytes], Any] = json.loads,
):
"""Normalize the cardinality limit config.

Normalization consists of deserializing and serializing back the given
cardinality limit config. If deserializing fails, throw an exception. Note that even if
the roundtrip doesn't produce errors, the given config may differ from
normalized one.

:param config: the cardinality limit config to validate.
:param json_dumps: a function that stringifies python objects
:param json_loads: a function that parses and converts JSON strings
"""
serialized = json_dumps(config)
normalized = rustcall(
lib.normalize_cardinality_limit_config, encode_str(serialized)
)
rv = decode_str(normalized, free=True)
try:
return json_loads(rv)
except Exception:
# Catch all errors since json.loads implementation can change.
raise ValueError(rv)


def normalize_global_config(
config,
json_dumps: Callable[[Any], Any] = json.dumps,
Expand Down
47 changes: 0 additions & 47 deletions py/tests/test_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,53 +329,6 @@ def test_normalize_project_config():
assert config != normalized


def test_cardinality_limit_config_equal_normalization():
config = {
"id": "project-override-custom",
"window": {"windowSeconds": 3600, "granularitySeconds": 600},
"limit": 1000,
"namespace": "custom",
"scope": "name",
"passive": True,
"report": True,
}
sentry_relay.normalize_cardinality_limit_config(config)
assert config == sentry_relay.normalize_cardinality_limit_config(config)


def test_cardinality_limit_config_subset_normalized():
config = {
"id": "project-override-custom",
"window": {"windowSeconds": 3600, "granularitySeconds": 600},
"limit": 1000,
"namespace": "custom",
"scope": "name",
"passive": False,
"report": False,
"unknown": "value",
}
normalized = sentry_relay.normalize_cardinality_limit_config(config)
config.pop("passive")
config.pop("report")
config.pop("unknown")
assert config == normalized


def test_cardinality_limit_config_unparsable():
config = {
"id": "project-override-custom",
"window": {"windowSeconds": 3600, "granularitySeconds": 600},
"limit": -1,
"namespace": "custom",
"scope": "name",
}
with pytest.raises(ValueError) as e:
sentry_relay.normalize_cardinality_limit_config(config)
assert (
str(e.value) == "invalid value: integer `-1`, expected u32 at line 1 column 107"
)


def test_global_config_equal_normalization():
config = {"measurements": {"maxCustomMeasurements": 0}}
assert config == sentry_relay.normalize_global_config(config)
Expand Down
1 change: 0 additions & 1 deletion relay-cabi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ lru = { workspace = true }
regex = { workspace = true }
relay-auth = { workspace = true }
relay-base-schema = { workspace = true }
relay-cardinality = { workspace = true }
relay-common = { workspace = true }
relay-dynamic-config = { workspace = true }
relay-event-normalization = { workspace = true }
Expand Down
12 changes: 0 additions & 12 deletions relay-cabi/src/processing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use std::slice;
use std::sync::OnceLock;

use chrono::{DateTime, Utc};
use relay_cardinality::CardinalityLimit;
use relay_dynamic_config::{GlobalConfig, ProjectConfig};
use relay_event_normalization::{
BreakdownsConfig, ClientHints, EventValidationConfig, GeoIpLookup, NormalizationConfig,
Expand Down Expand Up @@ -456,17 +455,6 @@ pub unsafe extern "C" fn relay_normalize_project_config(value: *const RelayStr)
}
}

/// Normalize a cardinality limit config.
#[unsafe(no_mangle)]
#[relay_ffi::catch_unwind]
pub unsafe extern "C" fn normalize_cardinality_limit_config(value: *const RelayStr) -> RelayStr {
let value = unsafe { (*value).as_str() };
match normalize_json::<CardinalityLimit>(value) {
Ok(normalized) => RelayStr::from_string(normalized),
Err(e) => RelayStr::from_string(e.to_string()),
}
}

/// Normalize a global config.
#[unsafe(no_mangle)]
#[relay_ffi::catch_unwind]
Expand Down
42 changes: 0 additions & 42 deletions relay-cardinality/Cargo.toml

This file was deleted.

20 changes: 0 additions & 20 deletions relay-cardinality/benches/redis.rs

This file was deleted.

Loading
Loading