Beats: docs for Metricbeat Prometheus module show confusing port for scraping Prometheus exporters

Created on 17 Mar 2019  路  4Comments  路  Source: elastic/beats

URL

  • Version: 7.0 beta 1
  • Operating System: Linux / Kubernetes
  • Steps to Reproduce:

The docs show this for scraping from an exporter:

- module: prometheus
  period: 10s
  hosts: ["localhost:9090"]
  metrics_path: /metrics

The 9090 is the problem. Port 9090 is the port of the Prometheus server, not any exporter. The ports for the exporters are here.

Here is what I would suggest:

To scrape metrics from a Prometheus exporter, configure the hosts field to it. The default port assignments for known exporters are documented in the Prometheus docs.The path to retrieve the metrics from (/metrics by default) can be configured with metrics_path. The following example collects Redis (port 9121) and HAProxy (port 9101) from the servers redisserver and haproxyserver respectively:

- module: prometheus
  period: 10s
  hosts: ["redisserver:9121", "haproxyserver:9101"]
  metrics_path: /metrics
Metricbeat Integrations bug docs

All 4 comments

Agreed, that's a tad confusing as an example for exporter scraping.

Fixed in the above PR. Not sure if we want to backport it?

Please do, it will be a long time before most of our customers upgrade to 7. Thanks Alex @fearful-symmetry

So it looks like 6.7 doesn't have _any_ of this documentation, as #9948 was never backported that far.

Was this page helpful?
0 / 5 - 0 ratings