Skip to content

Commit 6e20f7c

Browse files
committed
ref(spans): Always emit a usage metric
1 parent aa11124 commit 6e20f7c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

relay-dynamic-config/src/defaults.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ pub fn add_span_metrics(project_config: &mut ProjectConfig) {
1414

1515
let features = &project_config.features;
1616

17-
if !config.is_supported() || config._span_metrics_extended || !features.produces_spans() {
17+
if !config.is_supported() || config._span_metrics_extended {
1818
return;
1919
}
20+
config._span_metrics_extended = true;
2021

2122
// If there are any spans in the system, extract the usage metric for them:
2223
config.metrics.push(MetricSpec {
@@ -27,6 +28,10 @@ pub fn add_span_metrics(project_config: &mut ProjectConfig) {
2728
tags: vec![],
2829
});
2930

31+
if !features.produces_spans() {
32+
return;
33+
}
34+
3035
config
3136
.global_groups
3237
.entry(GroupKey::SpanMetricsCommon)
@@ -38,7 +43,6 @@ pub fn add_span_metrics(project_config: &mut ProjectConfig) {
3843
.or_default()
3944
.is_enabled = true;
4045

41-
config._span_metrics_extended = true;
4246
if config.version == 0 {
4347
config.version = MetricExtractionConfig::MAX_SUPPORTED_VERSION;
4448
}

0 commit comments

Comments
 (0)