Skip to content
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

feat(spans): Collect exclusive time for all spans #3268

Merged
merged 11 commits into from
Mar 18, 2024
17 changes: 17 additions & 0 deletions relay-dynamic-config/src/defaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,23 @@ fn span_metrics() -> impl IntoIterator<Item = MetricSpec> {
.when(is_http.clone()),
],
},
MetricSpec {
category: DataCategory::Span,
mri: "d:spans/exclusive_time@millisecond".into(),
field: Some("span.exclusive_time".into()),
condition: None,
tags: vec![
Tag::with_key("transaction")
.from_field("span.sentry_tags.transaction")
.always(),
Tag::with_key("environment")
.from_field("span.sentry_tags.environment")
.always(),
Tag::with_key("span.op")
.from_field("span.sentry_tags.op")
.always(),
],
},
MetricSpec {
category: DataCategory::Span,
mri: "d:spans/http.response_content_length@byte".into(),
Expand Down
13 changes: 9 additions & 4 deletions relay-server/src/metrics_extraction/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1299,6 +1299,7 @@ mod tests {
vec![
"d:spans/exclusive_time@millisecond",
"d:spans/exclusive_time_light@millisecond",
"d:spans/exclusive_time@millisecond",
"c:spans/count_per_op@none",
"c:spans/count_per_segment@none"
]
Expand All @@ -1308,7 +1309,7 @@ mod tests {
#[test]
fn test_app_start_cold_outlier() {
let metrics = extract_span_metrics_mobile("app.start.cold", 181000.0);
assert!(metrics.is_empty());
assert_eq!(metrics.len(), 1);
}

#[test]
Expand All @@ -1319,6 +1320,7 @@ mod tests {
vec![
"d:spans/exclusive_time@millisecond",
"d:spans/exclusive_time_light@millisecond",
"d:spans/exclusive_time@millisecond",
"c:spans/count_per_op@none",
"c:spans/count_per_segment@none"
]
Expand All @@ -1328,7 +1330,7 @@ mod tests {
#[test]
fn test_app_start_warm_outlier() {
let metrics = extract_span_metrics_mobile("app.start.warm", 181000.0);
assert!(metrics.is_empty());
assert_eq!(metrics.len(), 1);
}

#[test]
Expand All @@ -1339,6 +1341,7 @@ mod tests {
vec![
"d:spans/exclusive_time@millisecond",
"d:spans/exclusive_time_light@millisecond",
"d:spans/exclusive_time@millisecond",
"c:spans/count_per_op@none",
"c:spans/count_per_segment@none"
]
Expand All @@ -1348,7 +1351,7 @@ mod tests {
#[test]
fn test_ui_load_initial_display_outlier() {
let metrics = extract_span_metrics_mobile("ui.load.initial_display", 181000.0);
assert!(metrics.is_empty());
assert_eq!(metrics.len(), 1);
}

#[test]
Expand All @@ -1359,6 +1362,7 @@ mod tests {
vec![
"d:spans/exclusive_time@millisecond",
"d:spans/exclusive_time_light@millisecond",
"d:spans/exclusive_time@millisecond",
"c:spans/count_per_op@none",
"c:spans/count_per_segment@none"
]
Expand All @@ -1368,7 +1372,7 @@ mod tests {
#[test]
fn test_ui_load_full_display_outlier() {
let metrics = extract_span_metrics_mobile("ui.load.full_display", 181000.0);
assert!(metrics.is_empty());
assert_eq!(metrics.len(), 1);
}

#[test]
Expand Down Expand Up @@ -1403,6 +1407,7 @@ mod tests {
}
assert_eq!(metric.tag("ttid"), Some("ttid"));
assert_eq!(metric.tag("ttfd"), Some("ttfd"));
break;
}
}

Expand Down
Loading