Skip to content

Commit 69ef868

Browse files
Fix span metric names (#5665)
1 parent ac8dc9d commit 69ef868

File tree

3 files changed

+27
-27
lines changed

3 files changed

+27
-27
lines changed

internal-api/src/main/java/datadog/trace/api/metrics/SpanMetricsImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ public SpanMetricsImpl(String instrumentationName) {
1818
this.spanCreatedCounter = new AtomicLong(0);
1919
this.spanFinishedCounter = new AtomicLong(0);
2020
List<CoreCounter> coreCounters = new ArrayList<>(2);
21-
coreCounters.add(new SpanCounter("span_created", this.spanCreatedCounter));
22-
coreCounters.add(new SpanCounter("span_finished", this.spanFinishedCounter));
21+
coreCounters.add(new SpanCounter("spans_created", this.spanCreatedCounter));
22+
coreCounters.add(new SpanCounter("spans_finished", this.spanFinishedCounter));
2323
this.coreCounters = Collections.unmodifiableList(coreCounters);
2424
}
2525

internal-api/src/test/groovy/datadog/trace/api/telemetry/TelemetryCollectorsTest.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,14 @@ class TelemetryCollectorsTest extends DDSpecification {
208208
spanCreatedMetric.type == 'count'
209209
spanCreatedMetric.value == 2
210210
spanCreatedMetric.namespace == 'tracers'
211-
spanCreatedMetric.metricName == 'span_created'
211+
spanCreatedMetric.metricName == 'spans_created'
212212
spanCreatedMetric.tags == ['test-update-drain']
213213

214214
def spanFinishedMetric = metrics[1]
215215
spanFinishedMetric.type == 'count'
216216
spanFinishedMetric.value == 1
217217
spanFinishedMetric.namespace == 'tracers'
218-
spanFinishedMetric.metricName == 'span_finished'
218+
spanFinishedMetric.metricName == 'spans_finished'
219219
spanFinishedMetric.tags == ['test-update-drain']
220220
}
221221

telemetry/src/test/groovy/datadog/telemetry/metric/CoreMetricsPeriodActionTest.groovy

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ class CoreMetricsPeriodActionTest extends Specification {
3232

3333
then:
3434
1 * telemetryService.addMetric({ Metric metric ->
35-
assertMetric(metric, 'span_created', 'instr-1', 2)
35+
assertMetric(metric, 'spans_created', 'instr-1', 2)
3636
})
3737
1 * telemetryService.addMetric({ Metric metric ->
38-
assertMetric(metric, 'span_created', 'instr-2', 3)
38+
assertMetric(metric, 'spans_created', 'instr-2', 3)
3939
})
4040
1 * telemetryService.addMetric({ Metric metric ->
41-
assertMetric(metric, 'span_finished', 'instr-2', 4)
41+
assertMetric(metric, 'spans_finished', 'instr-2', 4)
4242
})
4343
0 * _
4444
}
@@ -71,34 +71,34 @@ class CoreMetricsPeriodActionTest extends Specification {
7171

7272
then:
7373
1 * telemetryService.addMetric({ Metric metric ->
74-
assertMetric(metric, 'span_created', 'instr-1', 1)
74+
assertMetric(metric, 'spans_created', 'instr-1', 1)
7575
})
7676
1 * telemetryService.addMetric({ Metric metric ->
77-
assertMetric(metric, 'span_created', 'instr-2', 1)
77+
assertMetric(metric, 'spans_created', 'instr-2', 1)
7878
})
7979
1 * telemetryService.addMetric({ Metric metric ->
80-
assertMetric(metric, 'span_created', 'instr-3', 1)
80+
assertMetric(metric, 'spans_created', 'instr-3', 1)
8181
})
8282
1 * telemetryService.addMetric({ Metric metric ->
83-
assertMetric(metric, 'span_finished', 'instr-3', 1)
83+
assertMetric(metric, 'spans_finished', 'instr-3', 1)
8484
})
8585
1 * telemetryService.addMetric({ Metric metric ->
86-
assertMetric(metric, 'span_created', 'instr-a', 1)
86+
assertMetric(metric, 'spans_created', 'instr-a', 1)
8787
})
8888
1 * telemetryService.addMetric({ Metric metric ->
89-
assertMetric(metric, 'span_created', 'instr-b', 1)
89+
assertMetric(metric, 'spans_created', 'instr-b', 1)
9090
})
9191
1 * telemetryService.addMetric({ Metric metric ->
92-
assertMetric(metric, 'span_finished', 'instr-b', 1)
92+
assertMetric(metric, 'spans_finished', 'instr-b', 1)
9393
})
9494
1 * telemetryService.addMetric({ Metric metric ->
95-
assertMetric(metric, 'span_finished', 'instr-2', 1)
95+
assertMetric(metric, 'spans_finished', 'instr-2', 1)
9696
})
9797
1 * telemetryService.addMetric({ Metric metric ->
98-
assertMetric(metric, 'span_finished', 'instr-a', 1)
98+
assertMetric(metric, 'spans_finished', 'instr-a', 1)
9999
})
100100
1 * telemetryService.addMetric({ Metric metric ->
101-
assertMetric(metric, 'span_finished', 'instr-1', 1)
101+
assertMetric(metric, 'spans_finished', 'instr-1', 1)
102102
})
103103
0 * _
104104
}
@@ -131,34 +131,34 @@ class CoreMetricsPeriodActionTest extends Specification {
131131

132132
then:
133133
1 * telemetryService.addMetric({ Metric metric ->
134-
assertMetric(metric, 'span_created', 'instr-1', 1)
134+
assertMetric(metric, 'spans_created', 'instr-1', 1)
135135
})
136136
1 * telemetryService.addMetric({ Metric metric ->
137-
assertMetric(metric, 'span_created', 'instr-2', 1)
137+
assertMetric(metric, 'spans_created', 'instr-2', 1)
138138
})
139139
1 * telemetryService.addMetric({ Metric metric ->
140-
assertMetric(metric, 'span_created', 'instr-3', 1)
140+
assertMetric(metric, 'spans_created', 'instr-3', 1)
141141
})
142142
1 * telemetryService.addMetric({ Metric metric ->
143-
assertMetric(metric, 'span_finished', 'instr-3', 1)
143+
assertMetric(metric, 'spans_finished', 'instr-3', 1)
144144
})
145145
1 * telemetryService.addMetric({ Metric metric ->
146-
assertMetric(metric, 'span_created', 'instr-a', 1)
146+
assertMetric(metric, 'spans_created', 'instr-a', 1)
147147
})
148148
1 * telemetryService.addMetric({ Metric metric ->
149-
assertMetric(metric, 'span_created', 'instr-b', 1)
149+
assertMetric(metric, 'spans_created', 'instr-b', 1)
150150
})
151151
1 * telemetryService.addMetric({ Metric metric ->
152-
assertMetric(metric, 'span_finished', 'instr-b', 1)
152+
assertMetric(metric, 'spans_finished', 'instr-b', 1)
153153
})
154154
1 * telemetryService.addMetric({ Metric metric ->
155-
assertMetric(metric, 'span_finished', 'instr-2', 1)
155+
assertMetric(metric, 'spans_finished', 'instr-2', 1)
156156
})
157157
1 * telemetryService.addMetric({ Metric metric ->
158-
assertMetric(metric, 'span_finished', 'instr-a', 1)
158+
assertMetric(metric, 'spans_finished', 'instr-a', 1)
159159
})
160160
1 * telemetryService.addMetric({ Metric metric ->
161-
assertMetric(metric, 'span_finished', 'instr-1', 1)
161+
assertMetric(metric, 'spans_finished', 'instr-1', 1)
162162
})
163163
0 * _
164164
}

0 commit comments

Comments
 (0)