Skip to content

Commit

Permalink
an extra test for info metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
gsantoro committed Dec 14, 2023
1 parent 881c084 commit a09cb62
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion metricbeat/helper/prometheus/prometheus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -551,10 +551,26 @@ func TestInfoMetricPrometheus(t *testing.T) {
expected []mapstr.M
}{
{
msg: "Simple field map",
msg: "Ignore metrics not in mapping",
mapping: &MetricsMapping{
Metrics: map[string]MetricMap{
"first_metric": Metric("first.metric"),
},
},
expected: []mapstr.M{
mapstr.M{
"first": mapstr.M{
"metric": 1.0,
},
},
},
},
{
msg: "Ignore metric in mapping but of unsupported type (eg. Info metric)",
mapping: &MetricsMapping{
Metrics: map[string]MetricMap{
"first_metric": Metric("first.metric"),
"target_info": Metric("target.info"),
},
},
expected: []mapstr.M{
Expand Down

0 comments on commit a09cb62

Please sign in to comment.