Skip to content

Commit

Permalink
Hardcode namespace for prometheus metrics (#12400)
Browse files Browse the repository at this point in the history
All prometheus metrics should be under `prometheus.metrics`, fix it so
the metricset can be reused on light modules (#12270).
  • Loading branch information
jsoriano authored Jun 3, 2019
1 parent 97404f9 commit 3ab727b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion metricbeat/module/prometheus/collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ func (m *MetricSet) Fetch(reporter mb.ReporterV2) {

// Converts hash list to slice
for _, e := range eventList {
reporter.Event(mb.Event{ModuleFields: e})
reporter.Event(mb.Event{
RootFields: common.MapStr{"prometheus": e},
})
}
}

0 comments on commit 3ab727b

Please sign in to comment.