Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update doc and reference config for prometheus default metricset #6747

Merged
merged 1 commit into from
Apr 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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