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
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.