diff --git a/relay-conventions/build/attributes.rs b/relay-conventions/build/attributes.rs index 34f56e201d5..123fd980e04 100644 --- a/relay-conventions/build/attributes.rs +++ b/relay-conventions/build/attributes.rs @@ -40,6 +40,11 @@ pub enum DeprecationStatus { Backfill, /// Only write the replacement name. Normalize, + /// Dedicated transformation code handles the move-and-reshape. + /// + /// Produces `WriteBehavior::CurrentName` so the generic renaming logic + /// leaves these attributes alone. + Transform, } /// Information about an attribute's deprecation. @@ -123,7 +128,9 @@ fn format_write_behavior(deprecation: Option<&Deprecation>) -> String { DeprecationStatus::Backfill => { format!("WriteBehavior::BothNames({name})") } - DeprecationStatus::Normalize => { + // Transform is treated as Normalize until dedicated transformation + // code is added. + DeprecationStatus::Normalize | DeprecationStatus::Transform => { format!("WriteBehavior::NewName({name})") } } diff --git a/relay-conventions/sentry-conventions b/relay-conventions/sentry-conventions index e148509bed5..697cdccfed7 160000 --- a/relay-conventions/sentry-conventions +++ b/relay-conventions/sentry-conventions @@ -1 +1 @@ -Subproject commit e148509bed52d260f9abb75876de963a54f14b30 +Subproject commit 697cdccfed773f79509f9701607c7684ca16d4e2 diff --git a/relay-event-normalization/src/eap/mobile.rs b/relay-event-normalization/src/eap/mobile.rs index c7e95db2989..4de5265df54 100644 --- a/relay-event-normalization/src/eap/mobile.rs +++ b/relay-event-normalization/src/eap/mobile.rs @@ -101,7 +101,10 @@ pub fn normalize_mobile_measurements( .and_then(|v| v.as_f64()) { let frames_frozen_rate = frames_frozen / frames_total; - attributes.insert(FRAMES_FROZEN_RATE.to_owned(), frames_frozen_rate); + attributes.insert( + APP__VITALS__FRAMES__FROZEN__RATE.to_owned(), + frames_frozen_rate, + ); } if let Some(frames_slow) = attributes @@ -109,7 +112,7 @@ pub fn normalize_mobile_measurements( .and_then(|v| v.as_f64()) { let frames_slow_rate = frames_slow / frames_total; - attributes.insert(FRAMES_SLOW_RATE.to_owned(), frames_slow_rate); + attributes.insert(APP__VITALS__FRAMES__SLOW__RATE.to_owned(), frames_slow_rate); } } @@ -117,11 +120,11 @@ pub fn normalize_mobile_measurements( if let Some(span_duration) = span_duration && !span_duration.is_zero() && let Some(stall_total_time_ms) = attributes - .get_value(STALL_TOTAL_TIME) + .get_value(APP__VITALS__STALL__DURATION) .and_then(|v| v.as_f64()) { let stall_percentage = stall_total_time_ms / (span_duration.as_millis() as f64); - attributes.insert(STALL_PERCENTAGE.to_owned(), stall_percentage); + attributes.insert(APP__VITALS__STALL__PERCENTAGE.to_owned(), stall_percentage); } } diff --git a/relay-event-normalization/src/eap/mod.rs b/relay-event-normalization/src/eap/mod.rs index 7f5da87843b..1da8ab8acd2 100644 --- a/relay-event-normalization/src/eap/mod.rs +++ b/relay-event-normalization/src/eap/mod.rs @@ -3099,20 +3099,36 @@ mod tests { normalize_attribute_names(&mut attributes); normalize_mobile_measurements(&mut attributes, Some(Duration::from_secs(5))); - insta::assert_json_snapshot!(SerializableAnnotated(&attributes), @r###" + insta::assert_json_snapshot!(SerializableAnnotated(&attributes), @r#" { "app.vitals.frames.frozen.count": { "type": "integer", "value": 2 }, + "app.vitals.frames.frozen.rate": { + "type": "double", + "value": 0.5 + }, "app.vitals.frames.slow.count": { "type": "integer", "value": 1 }, + "app.vitals.frames.slow.rate": { + "type": "double", + "value": 0.25 + }, "app.vitals.frames.total.count": { "type": "integer", "value": 4 }, + "app.vitals.stall.duration": { + "type": "integer", + "value": 4000 + }, + "app.vitals.stall.percentage": { + "type": "double", + "value": 0.8 + }, "frames.slow": { "type": "integer", "value": 1 @@ -3121,23 +3137,11 @@ mod tests { "type": "integer", "value": 4 }, - "frames_frozen_rate": { - "type": "double", - "value": 0.5 - }, - "frames_slow_rate": { - "type": "double", - "value": 0.25 - }, - "stall_percentage": { - "type": "double", - "value": 0.8 - }, "stall_total_time": { "type": "integer", "value": 4000 } } - "###); + "#); } } diff --git a/tests/integration/test_ai.py b/tests/integration/test_ai.py index 8eaf4b185e2..d35f6ed4c2f 100644 --- a/tests/integration/test_ai.py +++ b/tests/integration/test_ai.py @@ -1323,7 +1323,6 @@ def test_ai_spans_example_transaction( "sentry.segment.id": {"type": "string", "value": "657cf984a6a4e59b"}, "sentry.segment.name": {"type": "string", "value": "main"}, "sentry.source": {"type": "string", "value": "custom"}, - "sentry.span.source": {"type": "string", "value": "custom"}, "sentry.status": {"type": "string", "value": "ok"}, "sentry.trace.status": {"type": "string", "value": "ok"}, "sentry.transaction.op": { diff --git a/tests/integration/test_spans_standalone.py b/tests/integration/test_spans_standalone.py index b1bf37953bd..e77f45465fb 100644 --- a/tests/integration/test_spans_standalone.py +++ b/tests/integration/test_spans_standalone.py @@ -851,13 +851,13 @@ def test_mobile_measurements( "type": "string", "value": time_within_delta(expect_resolution="ns"), }, - "stall_total_time": {"value": 4000.0, "type": "double"}, - "stall_percentage": {"value": 0.8, "type": "double"}, + "app.vitals.stall.duration": {"value": 4000.0, "type": "double"}, + "app.vitals.stall.percentage": {"value": 0.8, "type": "double"}, "app.vitals.frames.slow.count": {"value": 1.0, "type": "double"}, "app.vitals.frames.frozen.count": {"value": 2.0, "type": "double"}, "app.vitals.frames.total.count": {"value": 4.0, "type": "double"}, - "frames_frozen_rate": {"value": 0.5, "type": "double"}, - "frames_slow_rate": {"value": 0.25, "type": "double"}, + "app.vitals.frames.frozen.rate": {"value": 0.5, "type": "double"}, + "app.vitals.frames.slow.rate": {"value": 0.25, "type": "double"}, "app.vitals.start.cold.value": {"value": 0.123, "type": "double"}, "app.vitals.start.value": {"value": 0.123, "type": "double"}, "app.vitals.start.type": {"value": "cold", "type": "string"},