-
Notifications
You must be signed in to change notification settings - Fork 114
fix(span): Make _performance_issues_spans a top-level field #5870
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
base: master
Are you sure you want to change the base?
Changes from all commits
1504eda
2c662d0
0903f1d
03ee6f7
9e40ff6
c256f63
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -44,6 +44,7 @@ pub fn convert(span: IndexedSpanOnly, ctx: &Context) -> Result<Box<StoreSpanV2>> | |||||
| routing_key, | ||||||
| retention_days: ctx.retention.standard, | ||||||
| downsampled_retention_days: ctx.retention.downsampled, | ||||||
| performance_issues_spans: false, | ||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| item: span, | ||||||
| })) | ||||||
| } | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -137,6 +137,10 @@ pub struct StoreSpanV2 { | |||||||||
| pub retention_days: u16, | ||||||||||
| /// Downsampled retention of the span. | ||||||||||
| pub downsampled_retention_days: u16, | ||||||||||
| /// Temporary flag controlling where performance issues are detected. | ||||||||||
| /// | ||||||||||
| /// Travels on the Kafka envelope (`SpanMeta`) rather than the SpanV2 body. | ||||||||||
|
Comment on lines
+141
to
+142
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
| pub performance_issues_spans: bool, | ||||||||||
| /// The final Sentry compatible span item. | ||||||||||
| pub item: SpanV2, | ||||||||||
| } | ||||||||||
|
|
@@ -788,6 +792,7 @@ impl StoreService { | |||||||||
| downsampled_retention_days: message.downsampled_retention_days, | ||||||||||
| received: datetime_to_timestamp(received_at), | ||||||||||
| accepted_outcome_emitted: relay_emits_accepted_outcome, | ||||||||||
| performance_issues_spans: message.performance_issues_spans, | ||||||||||
| }; | ||||||||||
|
|
||||||||||
| message.try_accept(|span| { | ||||||||||
|
|
@@ -1677,6 +1682,17 @@ struct SpanMeta { | |||||||||
| downsampled_retention_days: u16, | ||||||||||
| /// Indicates whether Relay already emitted an accepted outcome or if EAP still needs to emit it. | ||||||||||
| accepted_outcome_emitted: bool, | ||||||||||
| /// Temporary flag that controls where performance issues are detected. | ||||||||||
| /// | ||||||||||
| /// When the flag is set to true, performance issues will be detected on this span provided it | ||||||||||
| /// is a root (segment) instead of the transaction event. | ||||||||||
|
Comment on lines
+1687
to
+1688
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
| /// | ||||||||||
| /// Only set on root spans extracted from transactions. | ||||||||||
| #[serde( | ||||||||||
| rename = "_performance_issues_spans", | ||||||||||
| skip_serializing_if = "std::ops::Not::not" | ||||||||||
| )] | ||||||||||
| performance_issues_spans: bool, | ||||||||||
| } | ||||||||||
|
|
||||||||||
| #[derive(Clone, Debug, Serialize)] | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -38,7 +38,7 @@ pub fn span_v1_to_span_v2(span_v1: SpanV1) -> SpanV2 { | |||||
| platform, | ||||||
| was_transaction, | ||||||
| kind, | ||||||
| performance_issues_spans, | ||||||
| performance_issues_spans: _, // moved to SpanMeta on the Kafka envelope | ||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| other: _, | ||||||
| } = span_v1; | ||||||
|
|
||||||
|
|
@@ -55,10 +55,6 @@ pub fn span_v1_to_span_v2(span_v1: SpanV1) -> SpanV2 { | |||||
| attributes.insert("sentry.profile_id", profile_id.map_value(|v| v.to_string())); | ||||||
| attributes.insert("sentry.platform", platform); | ||||||
| attributes.insert("sentry.was_transaction", was_transaction); | ||||||
| attributes.insert( | ||||||
| "sentry._internal.performance_issues_spans", | ||||||
| performance_issues_spans, | ||||||
| ); | ||||||
|
|
||||||
| // Use same precedence as `backfill_data` for data bags: | ||||||
| if let Some(measurements) = measurements.into_value() { | ||||||
|
|
@@ -371,10 +367,6 @@ mod tests { | |||||
| "type": "string", | ||||||
| "value": "{\"numbers\":[1,2,3]}" | ||||||
| }, | ||||||
| "sentry._internal.performance_issues_spans": { | ||||||
| "type": "boolean", | ||||||
| "value": true | ||||||
| }, | ||||||
| "sentry.client_sample_rate": { | ||||||
| "type": "double", | ||||||
| "value": 0.11 | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.