Skip to content

Commit

Permalink
Update doc and reference config for prometheus default metricset (#6747)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoriano authored and ruflin committed Apr 4, 2018
1 parent 90af715 commit 687f59a
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ https://github.com/elastic/beats/compare/v6.0.0-beta2...master[Check the HEAD di
- Allow to disable labels `dedot` in Docker module, in favor of a safe way to keep dots. {pull}6490[6490]
- Add experimental module to collect metrics from munin nodes. {pull}6517[6517]
- Add support for wildcards and explicit metrics grouping in jolokia/jmx. {pull}6462[6462]
- Set `collector` as default metricset in Prometheus module. {pull}6636[6636]
- Set `collector` as default metricset in Prometheus module. {pull}6636[6636] {pull}6747[6747]
- Set `mntr` as default metricset in Zookeeper module. {pull}6674[6674]
- Set default metricsets in vSphere module. {pull}6676[6676]
- Set `status` as default metricset in Apache module. {pull}6673[6673]
Expand Down
4 changes: 2 additions & 2 deletions metricbeat/docs/modules/prometheus.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ beta[]
This module periodically fetches metrics from
https://prometheus.io/docs/[Prometheus].

The default metricset is `collector`.


[float]
=== Example configuration
Expand All @@ -21,10 +23,8 @@ in <<configuration-metricbeat>>. Here is an example configuration:
----
metricbeat.modules:
- module: prometheus
metricsets: ["stats"]
period: 10s
hosts: ["localhost:9090"]
metrics_path: /metrics
#namespace: example
----

Expand Down
11 changes: 10 additions & 1 deletion metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,18 @@ metricbeat.modules:
#----------------------------- Prometheus Module -----------------------------
- module: prometheus
metricsets: ["stats"]
enabled: true
period: 10s
hosts: ["localhost:9090"]
#metrics_path: /metrics
#namespace: example

- module: prometheus
metricsets: ["collector"]
enabled: true
period: 10s
hosts: ["localhost:9090"]
metrics_path: /metrics
#metrics_path: /metrics
#namespace: example

#------------------------------ RabbitMQ Module ------------------------------
Expand Down
15 changes: 15 additions & 0 deletions metricbeat/module/prometheus/_meta/config.reference.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- module: prometheus
metricsets: ["stats"]
enabled: true
period: 10s
hosts: ["localhost:9090"]
#metrics_path: /metrics
#namespace: example

- module: prometheus
metricsets: ["collector"]
enabled: true
period: 10s
hosts: ["localhost:9090"]
#metrics_path: /metrics
#namespace: example
2 changes: 0 additions & 2 deletions metricbeat/module/prometheus/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
- module: prometheus
metricsets: ["stats"]
period: 10s
hosts: ["localhost:9090"]
metrics_path: /metrics
#namespace: example
2 changes: 2 additions & 0 deletions metricbeat/module/prometheus/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
This module periodically fetches metrics from
https://prometheus.io/docs/[Prometheus].

The default metricset is `collector`.
6 changes: 3 additions & 3 deletions metricbeat/module/prometheus/stats/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ var (
)

func init() {
if err := mb.Registry.AddMetricSet("prometheus", "stats", New, hostParser); err != nil {
panic(err)
}
mb.Registry.MustAddMetricSet("prometheus", "stats", New,
mb.WithHostParser(hostParser),
)
}

type MetricSet struct {
Expand Down
2 changes: 0 additions & 2 deletions metricbeat/modules.d/prometheus.yml.disabled
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
- module: prometheus
metricsets: ["stats"]
period: 10s
hosts: ["localhost:9090"]
metrics_path: /metrics
#namespace: example

0 comments on commit 687f59a

Please sign in to comment.