Skip to content

Commit

Permalink
test no renaming in remap
Browse files Browse the repository at this point in the history
  • Loading branch information
mabdinur committed Aug 5, 2024
1 parent 9fa5dd4 commit 1997549
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/otlp/metrics/metrics_remapping_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,10 @@ func TestRemapAndRenameMetrics(t *testing.T) {
tt.in.Name() == "kafka.producer.record-retry-rate" ||
tt.in.Name() == "kafka.producer.record-send-rate"
remapMetrics(dest, tt.in)
// Ensure remapMetrics does not add the otel.* prefix to the metric name
if checkprefix {
require.False(t, strings.HasPrefix(tt.in.Name(), "otel."), "system.* and process.* and a subset of kafka metrics need to be prepended with the otel.* namespace")
}
require.Equal(t, dest.Len()-lena, len(tt.out), "unexpected number of metrics added")
for i, out := range tt.out {
assert.NoError(t, pmetrictest.CompareMetric(out, dest.At(dest.Len()-len(tt.out)+i)))
Expand Down

0 comments on commit 1997549

Please sign in to comment.