Skip to content

Commit

Permalink
Revert "feat(spans): Restrict extraction of span time metrics" (#3782)
Browse files Browse the repository at this point in the history
Some pages seem to rely on all spans having metrics, e.g.
https://sentry.io/performance/summary/spans/

Reverts #3768
  • Loading branch information
jjbayer authored Jul 2, 2024
1 parent 57b5dbd commit d895b7e
Show file tree
Hide file tree
Showing 8 changed files with 1,538 additions and 117 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
- Add web vitals support for mobile browsers. ([#3762](https://github.com/getsentry/relay/pull/3762))
- Accept profiler_id in the profile context. ([#3714](https://github.com/getsentry/relay/pull/3714))
- Support extrapolation of metrics extracted from sampled data, as long as the sample rate is set in the DynamicSamplingContext. ([#3753](https://github.com/getsentry/relay/pull/3753))
- Only extract span duration metrics for known modules. ([#3768](https://github.com/getsentry/relay/pull/3768))

## 24.6.0

Expand Down
12 changes: 2 additions & 10 deletions relay-dynamic-config/src/defaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,6 @@ pub fn hardcoded_span_metrics() -> Vec<(GroupKey, Vec<MetricSpec>, Vec<TagMappin
let is_app_start = RuleCondition::glob("span.op", "app.start.*")
& RuleCondition::eq("span.description", APP_START_ROOT_SPAN_DESCRIPTIONS);

// Metrics for common modules:
let is_common = is_app_start.clone()
| is_db.clone()
| is_resource.clone()
| is_http.clone()
| is_mobile.clone()
| is_interaction.clone();

// Metrics for addon modules are only extracted if the feature flag is enabled:
let is_addon = is_ai.clone() | is_queue_op.clone() | is_cache.clone();

Expand All @@ -211,7 +203,7 @@ pub fn hardcoded_span_metrics() -> Vec<(GroupKey, Vec<MetricSpec>, Vec<TagMappin
category: DataCategory::Span,
mri: "d:spans/exclusive_time@millisecond".into(),
field: Some("span.exclusive_time".into()),
condition: Some(!is_addon.clone() & is_common.clone()),
condition: Some(!is_addon.clone()),
tags: vec![],
},
MetricSpec {
Expand Down Expand Up @@ -286,7 +278,7 @@ pub fn hardcoded_span_metrics() -> Vec<(GroupKey, Vec<MetricSpec>, Vec<TagMappin
category: DataCategory::Span,
mri: "d:spans/duration@millisecond".into(),
field: Some("span.duration".into()),
condition: Some(!is_addon.clone() & is_common.clone()),
condition: Some(!is_addon.clone()),
tags: vec![],
},
MetricSpec {
Expand Down
16 changes: 0 additions & 16 deletions relay-event-normalization/src/normalize/span/tag_extraction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2430,20 +2430,4 @@ LIMIT 1
"admin@sentry.io"
);
}

#[test]
fn long_descriptions_are_truncated() {
let json = r#"{
"description": "SELECT column FROM table1 WHERE another_col = %s AND yet_another_col = something_very_longgggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg",
"op": "db"
}"#;

let span = Annotated::<Span>::from_json(json)
.unwrap()
.into_value()
.unwrap();

let tags = extract_tags(&span, 200, None, None, false, None);
assert_eq!(tags[&SpanTagKey::Description], "SELECT column FROM table1 WHERE another_col = %s AND yet_another_col = something_very_longggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg*");
}
}
Loading

0 comments on commit d895b7e

Please sign in to comment.