Skip to content

Commit 69e31e7

Browse files
author
naseemkullah
committed
add counter suffix test
Signed-off-by: naseemkullah <naseem@transit.app>
1 parent a52e16e commit 69e31e7

File tree

2 files changed

+26
-7
lines changed

2 files changed

+26
-7
lines changed

exporter/prometheusremotewriteexporter/helper_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,12 @@ func Test_getPromMetricName(t *testing.T) {
289289
ns1,
290290
"test_ns_" + validIntSum + counterSuffix,
291291
},
292+
{
293+
"already_has_total_suffix",
294+
validMetrics1[validAptlyNamedIntSum],
295+
ns1,
296+
"test_ns_" + validAptlyNamedIntSum,
297+
},
292298
{
293299
"dirty_string",
294300
validMetrics2[validIntGaugeDirty],

exporter/prometheusremotewriteexporter/testutil_test.go

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,14 @@ var (
8787
quantileValues = []float64{7, 8, 9}
8888
quantiles = getQuantiles(quantileBounds, quantileValues)
8989

90-
validIntGauge = "valid_IntGauge"
91-
validDoubleGauge = "valid_DoubleGauge"
92-
validIntSum = "valid_IntSum"
93-
validDoubleSum = "valid_DoubleSum"
94-
validIntHistogram = "valid_IntHistogram"
95-
validDoubleHistogram = "valid_DoubleHistogram"
96-
validDoubleSummary = "valid_DoubleSummary"
90+
validIntGauge = "valid_IntGauge"
91+
validDoubleGauge = "valid_DoubleGauge"
92+
validIntSum = "valid_IntSum"
93+
validAptlyNamedIntSum = "valid_IntSum_total"
94+
validDoubleSum = "valid_DoubleSum"
95+
validIntHistogram = "valid_IntHistogram"
96+
validDoubleHistogram = "valid_DoubleHistogram"
97+
validDoubleSummary = "valid_DoubleSummary"
9798

9899
validIntGaugeDirty = "*valid_IntGauge$"
99100

@@ -136,6 +137,18 @@ var (
136137
},
137138
},
138139
},
140+
validAptlyNamedIntSum: {
141+
Name: validAptlyNamedIntSum,
142+
Data: &otlp.Metric_IntSum{
143+
IntSum: &otlp.IntSum{
144+
DataPoints: []*otlp.IntDataPoint{
145+
getIntDataPoint(lbs1, intVal1, time1),
146+
nil,
147+
},
148+
AggregationTemporality: otlp.AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE,
149+
},
150+
},
151+
},
139152
validDoubleSum: {
140153
Name: validDoubleSum,
141154
Data: &otlp.Metric_DoubleSum{

0 commit comments

Comments
 (0)