Update prometheus configuration example for version 2.26+ (#18565)

* Update prometheus configuration example for version 2.26+

The bearer token configuration entry have changed format in the latest Prometheus (starting at version 2.26). 
Instead of bearer_token:, it needs a authorization: credentials: entry.

* Small tweak

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
Yannick Brosseau 2021-07-20 12:43:53 -04:00 committed by GitHub
parent 86436ca1a7
commit 523d1b0f3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -173,6 +173,23 @@ You can then configure Prometheus to fetch metrics from Home Assistant by adding
- targets: ['HOSTNAME:8123']
```
The format to configure the bearer token has changed in Prometheus 2.26, so if you have a newer version, you can use this configuration sample:
```yaml
# Example Prometheus scrape_configs entry (For version 2.26+
- job_name: "hass"
scrape_interval: 60s
metrics_path: /api/prometheus
# Long-Lived Access Token
authorization:
credentials: "your.longlived.token"
scheme: https
static_configs:
- targets: ['HOSTNAME:8123']
```
When looking into the metrics on the Prometheus side, there will be:
- All Home Assistant domains, which can be easily found through the common **namespace** prefix, if defined.