#Prometheus

1 messages · Page 1 of 1 (latest)

proven pewter
#

Has anyone got this running?
Using the native integration
Prometheus reports the home assistant instance as up
But can't add http:homassistantip:8123 as a data source in grafana

vital heath
#

The prometheus integration is not a prometheus data source or prometheus server. It exposes metrics in prometheus format that can be ingested into one.

proven pewter
#

Maybe I'm confused...and I'm being too vague...apologies. Let me elaborate...

#

I have Prometheus running, and my prometheus config yaml follows the HA docs.
Prometheus can see the data by as reported at <prom_ip>:9090/health
It shows my instance at http://<home-assistant-ip>:8123
With an endpoint of http://<home-assistant-ip>/api/prometheus
If I navigate to this I see data
When I add as a data source in Grafan (http://<home-assistant-ip>:8123) I get a 404 error. There was an error returned querying the Prometheus API.

vital heath
#

You use your prometheus to scape HA's data and then add prometheus a data source.

proven pewter
#

This is the problem, the data is there and being scraped....but can't add that instance as a source to Grafana

vital heath
#

What's it say?

proven pewter
#
404 Not Found - There was an error returned querying the Prometheus API.
vital heath
#

What address/URL did you give it?

proven pewter
#
<home-assistant-ip>:8123
#

As the data source in Grafana

vital heath
#

Again, grafana does not talk to HA. Use your prometheus URL.

proven pewter
#

Ok, I'll try, 2 mins

#

Right, I can add that
But don't see the node I set in the prom config yaml 🤦🏻‍♂️

vital heath
#

I don't have a prometheus instance right now (I use VictoriaMetrics) but you should be able to see the scrape jobs on its endpoint.

proven pewter
#

I can see data at <home-assistant-ip>:8123/api/prometheus

#

I'm certain this is a me error, misconfiguration

vital heath
#

What's your prometheus config look like?

#

Go to http://YOURPROMIP:9090/targets and see if you can see HA there.

proven pewter
#

My config:

global:
  scrape_interval: 1m
  scrape_timeout: 1m
  evaluation_interval: 1m

scrape_configs:
  - job_name: prometheus
    honor_timestamps: true
    scrape_interval: 1m
    scrape_timeout: 30s
    metrics_path: /metrics
    static_configs:
      - targets: ['localhost:9090']
  - job_name: node
    static_configs:
      - targets: ['192.168.1.129:9100']
  - job_name: home-assistant
    scrape_interval: 60s
    metrics_path: /api/prometheus
    authorization:
      credentials: "my long lived token"
    scheme: http
    static_configs:
      - targets: ['192.168.1.124:8123']

If I go to http://prom-ip:9090/targets I see them --> home-assistant, node and prometheus

vital heath
#

Can you query data directly in the prometheus UI?

proven pewter
vital heath
#

What if you just do {job="home-assistant"}? Maybe node_uname_info is not provided by HA.

#

I'd recommend you use grafana's explore functionality.

proven pewter
#

{job="home-assistant"} returns 1000+ results