From f8bc738548d895ce3149ab06539f3456846853d8 Mon Sep 17 00:00:00 2001 From: Arthur Silva Sens Date: Mon, 23 Dec 2024 10:30:40 -0300 Subject: [PATCH] Include colon in BuildCompliantMetricName test Signed-off-by: Arthur Silva Sens --- .../otlptranslator/prometheus/metric_name_builder_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/storage/remote/otlptranslator/prometheus/metric_name_builder_test.go b/storage/remote/otlptranslator/prometheus/metric_name_builder_test.go index 5d24789374..58cee59cf5 100644 --- a/storage/remote/otlptranslator/prometheus/metric_name_builder_test.go +++ b/storage/remote/otlptranslator/prometheus/metric_name_builder_test.go @@ -204,7 +204,9 @@ func TestBuildCompliantMetricNameWithSuffixes(t *testing.T) { // Slashes in units are converted. require.Equal(t, "system_io_foo_per_bar_total", BuildCompliantMetricName(createCounter("system.io", "foo/bar"), "", true)) require.Equal(t, "metric_with_foreign_characters_total", BuildCompliantMetricName(createCounter("metric_with_字符_foreign_characters", ""), "", true)) - require.Equal(t, "temperature_C", BuildCompliantMetricName(createGauge("temperature", "%*()°C"), "", true)) // Removes non aplhanumerical characters from units + + // Removes non aplhanumerical characters from units, but leaves colons. + require.Equal(t, "temperature_:C", BuildCompliantMetricName(createGauge("temperature", "%*()°:C"), "", true)) } func TestBuildCompliantMetricNameWithoutSuffixes(t *testing.T) {