From 523d1b0f3b15900ec117f18ede2896411369757d Mon Sep 17 00:00:00 2001 From: Yannick Brosseau Date: Tue, 20 Jul 2021 12:43:53 -0400 Subject: [PATCH] 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 --- source/_integrations/prometheus.markdown | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/source/_integrations/prometheus.markdown b/source/_integrations/prometheus.markdown index 3e541e0aa0b..b75a7403fcb 100644 --- a/source/_integrations/prometheus.markdown +++ b/source/_integrations/prometheus.markdown @@ -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.