Skip to content
Open
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 relay-cabi/src/processing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@ pub unsafe extern "C" fn relay_store_normalizer_normalize_event(
is_renormalize,
remove_other: config.remove_other.unwrap_or(!is_renormalize),
emit_event_errors: !is_renormalize,
device_class_synthesis_config: false, // only supported in relay
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was my main concern - should we keep this in place?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fine to run this from librelay as well.

enrich_spans: false,
max_tag_value_length: usize::MAX,
span_description_rules: None,
Expand Down
7 changes: 0 additions & 7 deletions relay-dynamic-config/src/feature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ pub enum Feature {
/// Serialized as `organizations:session-replay-video-disabled`.
#[serde(rename = "organizations:session-replay-video-disabled")]
SessionReplayVideoDisabled,
/// Enables device.class synthesis
///
/// Enables device.class tag synthesis on mobile events.
///
/// Serialized as `organizations:device-class-synthesis`.
#[serde(rename = "organizations:device-class-synthesis")]
DeviceClassSynthesis,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strictly speaking we should move this to GRADUATED_FEATURE_FLAGS (see above), but since the feature only adds data, it should be OK if customer relays stop running the normalization (our own relays will add the device class).

/// Allow ingestion of metrics in the "custom" namespace.
///
/// Serialized as `organizations:custom-metrics`.
Expand Down
8 changes: 1 addition & 7 deletions relay-event-normalization/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,6 @@ pub struct NormalizationConfig<'a> {
/// When enabled, adds errors in the meta to the event's errors.
pub emit_event_errors: bool,

/// When `true`, infers the device class from CPU and model.
pub device_class_synthesis_config: bool,

/// When `true`, extracts tags from event and spans and materializes them into `span.data`.
pub enrich_spans: bool,

Expand Down Expand Up @@ -190,7 +187,6 @@ impl Default for NormalizationConfig<'_> {
is_renormalize: Default::default(),
remove_other: Default::default(),
emit_event_errors: Default::default(),
device_class_synthesis_config: Default::default(),
enrich_spans: Default::default(),
max_tag_value_length: usize::MAX,
span_description_rules: Default::default(),
Expand Down Expand Up @@ -309,9 +305,7 @@ fn normalize(event: &mut Event, meta: &mut Meta, config: &NormalizationConfig) {
normalize_event_tags(event); // Tags are added to every metric

// TODO: Consider moving to store normalization
if config.device_class_synthesis_config {
normalize_device_class(event);
}
normalize_device_class(event);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cabi path now unconditionally strips client-set device.class tags

Medium Severity

The relay-cabi path previously had device_class_synthesis_config: false, meaning normalize_device_class was never called for cabi consumers. Now it runs unconditionally for all paths. The normalize_device_class function first removes any existing client-set device.class tag, then re-computes it from device context. For cabi consumers (e.g. sentry-native), this is a behavior change: client-set device.class tags will now be silently stripped, even when device context is insufficient to compute a replacement.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3d963b9. Configure here.

normalize_stacktraces(event);
normalize_exceptions(event); // Browser extension filters look at the stacktrace
normalize_user_agent(event, config.normalize_user_agent); // Legacy browsers filter
Expand Down
1 change: 0 additions & 1 deletion relay-server/src/processing/utils/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ pub fn normalize(
transaction_name_config: TransactionNameConfig {
rules: &project_info.config.tx_name_rules,
},
device_class_synthesis_config: project_info.has_feature(Feature::DeviceClassSynthesis),
enrich_spans: true,
max_tag_value_length: ctx
.config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,10 @@ expression: SerializableAnnotated(& event)
[
"a",
"b"
],
[
"device.class",
"2"
]
],
"extra": {
Expand Down
Loading