-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Carlos Pérez-Aradros Herce
committed
Jan 22, 2019
1 parent
28167f9
commit ec1feed
Showing
7 changed files
with
50 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
46
metricbeat/module/prometheus/collector/_meta/docs.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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__!=""}' | ||
------------------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters