@@ -20,6 +20,9 @@ pub struct CompatSpan {
2020 pub segment_id : Annotated < String > ,
2121 pub start_timestamp_ms : Annotated < u64 > , // TODO: remove from kafka schema, no longer used in consumer
2222 pub start_timestamp_precise : Annotated < Timestamp > ,
23+
24+ #[ metastructure( field = "_performance_issues_spans" ) ]
25+ pub performance_issues_spans : Annotated < bool > , // TODO: add to Kafka schema?
2326}
2427
2528impl TryFrom < SpanV2 > for CompatSpan {
@@ -73,13 +76,20 @@ impl TryFrom<SpanV2> for CompatSpan {
7376 }
7477
7578 if let Some ( segment_id) = attributes
76- . get_value ( "sentry.segment.id" ) // TODO: EAP expects `sentry.segment_id`, double write this somewhere.
79+ . get_value ( "sentry.segment.id" )
7780 . and_then ( Value :: as_str)
7881 {
7982 compat_span. segment_id = Annotated :: from ( segment_id. to_owned ( ) ) ;
8083 }
84+
85+ if let Some ( Value :: Bool ( b) ) =
86+ attributes. get_value ( "sentry._internal.performance_issues_spans" )
87+ {
88+ compat_span. performance_issues_spans = Annotated :: new ( * b) ;
89+ }
8190 }
8291
92+ // FIXME: preserve _meta everywhere (see a test failure).
8393 compat_span. span_v2 = span_v2;
8494 Ok ( compat_span)
8595 }
@@ -143,6 +153,10 @@ mod tests {
143153 "sentry.segment.name": {
144154 "value": "my 1st transaction",
145155 "type": "string"
156+ },
157+ "sentry._internal.performance_issues_spans": {
158+ "value": true,
159+ "type": "bool"
146160 }
147161 }
148162 }"# ;
@@ -165,6 +179,10 @@ mod tests {
165179 "type": "string",
166180 "value": "Chrome"
167181 },
182+ "sentry._internal.performance_issues_spans": {
183+ "type": "bool",
184+ "value": true
185+ },
168186 "sentry.description": {
169187 "type": "string",
170188 "value": "mydescription"
@@ -204,6 +222,7 @@ mod tests {
204222 },
205223 "data": {
206224 "browser.name": "Chrome",
225+ "sentry._internal.performance_issues_spans": true,
207226 "sentry.description": "mydescription",
208227 "sentry.environment": "prod",
209228 "sentry.op": "myop",
@@ -220,7 +239,8 @@ mod tests {
220239 "profile_id": "a0aaaaaaaaaaaaaaaaaaaaaaaaaaaaab",
221240 "segment_id": "FA90FDEAD5F74052",
222241 "start_timestamp_ms": 123000,
223- "start_timestamp_precise": 123.0
242+ "start_timestamp_precise": 123.0,
243+ "_performance_issues_spans": true
224244 }
225245 "### ) ;
226246 }
0 commit comments