Skip to content

Commit

Permalink
add already suffixed counter test
Browse files Browse the repository at this point in the history
Signed-off-by: naseemkullah <naseem@transit.app>
  • Loading branch information
naseemkullah committed Mar 8, 2021
1 parent a52e16e commit 3bd2bd7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
6 changes: 6 additions & 0 deletions exporter/prometheusremotewriteexporter/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,12 @@ func Test_getPromMetricName(t *testing.T) {
ns1,
"test_ns_" + validIntSum + counterSuffix,
},
{
"already_has_total_suffix",
validMetrics1[suffixedCounter],
ns1,
"test_ns_" + suffixedCounter,
},
{
"dirty_string",
validMetrics2[validIntGaugeDirty],
Expand Down
13 changes: 13 additions & 0 deletions exporter/prometheusremotewriteexporter/testutil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ var (
validIntHistogram = "valid_IntHistogram"
validDoubleHistogram = "valid_DoubleHistogram"
validDoubleSummary = "valid_DoubleSummary"
suffixedCounter = "valid_IntSum_total"

validIntGaugeDirty = "*valid_IntGauge$"

Expand Down Expand Up @@ -136,6 +137,18 @@ var (
},
},
},
suffixedCounter: {
Name: suffixedCounter,
Data: &otlp.Metric_IntSum{
IntSum: &otlp.IntSum{
DataPoints: []*otlp.IntDataPoint{
getIntDataPoint(lbs1, intVal1, time1),
nil,
},
AggregationTemporality: otlp.AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE,
},
},
},
validDoubleSum: {
Name: validDoubleSum,
Data: &otlp.Metric_DoubleSum{
Expand Down

0 comments on commit 3bd2bd7

Please sign in to comment.