Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Pérez-Aradros Herce committed Jan 22, 2019
1 parent 28167f9 commit ec1feed
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 58 deletions.
19 changes: 4 additions & 15 deletions metricbeat/docs/modules/prometheus.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ This file is generated! See scripts/docs_collector.py
[[metricbeat-module-prometheus]]
== Prometheus module

This module periodically fetches metrics from
This module periodically scrapes metrics from
https://prometheus.io/docs/[Prometheus].

The default metricset is `collector`.


[float]
=== Example configuration
Expand All @@ -21,20 +19,11 @@ in <<configuration-metricbeat>>. Here is an example configuration:
----
metricbeat.modules:
- 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
metrics_path: /metrics
#username: "user"
#password: "secret"
# This can be used for service account based authorization:
# bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
Expand Down
15 changes: 3 additions & 12 deletions metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -566,20 +566,11 @@ 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
#namespace: example
metrics_path: /metrics
#username: "user"
#password: "secret"

# This can be used for service account based authorization:
# bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
Expand Down
20 changes: 0 additions & 20 deletions metricbeat/module/prometheus/_meta/config.reference.yml

This file was deleted.

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
Expand Down
4 changes: 1 addition & 3 deletions metricbeat/module/prometheus/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
This module periodically fetches metrics from
This module periodically scrapes metrics from
https://prometheus.io/docs/[Prometheus].

The default metricset is `collector`.
46 changes: 42 additions & 4 deletions metricbeat/module/prometheus/collector/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,43 @@
The Prometheus `collector` metricset fetches data from https://prometheus.io/docs/instrumenting/exporters/[prometheus exporters].
The Prometheus `collector` metricset scrapes data from https://prometheus.io/docs/instrumenting/exporters/[prometheus exporters].

All events with the same labels are grouped together as one event. The fields
exported by this metricset vary depending on the Prometheus exporter that you're
using.

[float]
=== Scraping from a Prometheus exporter

To scrape metrics from a Prometheus exporter, configure the `hosts` field to it. The path
to retrieve the metrics from (`/metrics` by default) can be configured with `metrics_path`.

[source,yaml]
-------------------------------------------------------------------------------------
- module: prometheus
period: 10s
hosts: ["localhost:9090"]
metrics_path: /metrics
#username: "user"
#password: "secret"
# This can be used for service account based authorization:
# bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
#ssl.certificate_authorities:
# - /var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt
-------------------------------------------------------------------------------------


[float]
=== Scraping all metrics from a Prometheus server

This module can scrape all metrics stored in a Prometheus server, by using the
https://prometheus.io/docs/prometheus/latest/federation/[federation API]. By pointing this
config to the Prometheus server:

[source,yaml]
-------------------------------------------------------------------------------------
metricbeat.modules:
- module: prometheus
period: 10s
hosts: ["localhost:9090"]
metrics_path: '/federate'
query:
'match[]': '{__name__!=""}'
-------------------------------------------------------------------------------------
2 changes: 0 additions & 2 deletions metricbeat/modules.d/prometheus.yml.disabled
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# Docs: https://www.elastic.co/guide/en/beats/metricbeat/master/metricbeat-module-prometheus.html

- module: prometheus
#metricsets:
# - stats
period: 10s
hosts: ["localhost:9090"]
metrics_path: /metrics
Expand Down

0 comments on commit ec1feed

Please sign in to comment.