Skip to content

Commit b35ad99

Browse files
committedMar 13, 2025··
Add test case for BuildCompliantMetricName with a metric that starts with a digit and addMetricSuffixes is true
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
1 parent 227989c commit b35ad99

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
 

‎otlptranslator/metric_name_builder_test.go

+8
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,14 @@ func TestBuildCompliantMetricName(t *testing.T) {
238238
addMetricSuffixes: false,
239239
expected: "_5xx_errors",
240240
},
241+
{
242+
name: "metric name starting with digit, with suffixes",
243+
metricName: "5xx_errors",
244+
unit: "",
245+
metricType: MetricTypeMonotonicCounter,
246+
addMetricSuffixes: true,
247+
expected: "_5xx_errors_total",
248+
},
241249
{
242250
name: "metric name with multiple consecutive invalid chars",
243251
metricName: "api..//request--time",

0 commit comments

Comments
 (0)
Please sign in to comment.