File tree Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## Unreleased
4
4
5
+ ** Features** :
6
+
7
+ - Always emit a span usage metric, independent of span feature flags. ([ #4976 ] ( https://github.com/getsentry/relay/pull/4976 ) )
8
+
5
9
** Bug Fixes** :
6
10
7
11
- Normalize OS and Browser names in contexts when missing a version. ([ #4957 ] ( https://github.com/getsentry/relay/pull/4957 ) )
Original file line number Diff line number Diff line change @@ -14,9 +14,10 @@ pub fn add_span_metrics(project_config: &mut ProjectConfig) {
14
14
15
15
let features = & project_config. features ;
16
16
17
- if !config. is_supported ( ) || config. _span_metrics_extended || !features . produces_spans ( ) {
17
+ if !config. is_supported ( ) || config. _span_metrics_extended {
18
18
return ;
19
19
}
20
+ config. _span_metrics_extended = true ;
20
21
21
22
// If there are any spans in the system, extract the usage metric for them:
22
23
config. metrics . push ( MetricSpec {
@@ -27,6 +28,10 @@ pub fn add_span_metrics(project_config: &mut ProjectConfig) {
27
28
tags : vec ! [ ] ,
28
29
} ) ;
29
30
31
+ if !features. produces_spans ( ) {
32
+ return ;
33
+ }
34
+
30
35
config
31
36
. global_groups
32
37
. entry ( GroupKey :: SpanMetricsCommon )
@@ -38,7 +43,6 @@ pub fn add_span_metrics(project_config: &mut ProjectConfig) {
38
43
. or_default ( )
39
44
. is_enabled = true ;
40
45
41
- config. _span_metrics_extended = true ;
42
46
if config. version == 0 {
43
47
config. version = MetricExtractionConfig :: MAX_SUPPORTED_VERSION ;
44
48
}
Original file line number Diff line number Diff line change @@ -1276,7 +1276,14 @@ mod tests {
1276
1276
#[ test]
1277
1277
fn no_feature_flags_enabled ( ) {
1278
1278
let metrics = extract_span_metrics ( [ ] ) ;
1279
- assert ! ( metrics. project_metrics. is_empty( ) ) ;
1279
+
1280
+ assert_eq ! ( metrics. project_metrics. len( ) , 75 ) ;
1281
+ assert ! (
1282
+ metrics
1283
+ . project_metrics
1284
+ . into_iter( )
1285
+ . all( |x| & x. name == "c:spans/usage@none" )
1286
+ ) ;
1280
1287
1281
1288
assert_eq ! ( metrics. sampling_metrics. len( ) , 1 ) ;
1282
1289
assert_eq ! (
You can’t perform that action at this time.
0 commit comments