aauren / ntopng-exporter

A Prometheus Exporter for ntopng Metrics
GNU General Public License v3.0
28 stars 4 forks source link

Grafana Error - "Failed to get prometheus buildinfo" #10

Closed PC-Admin closed 10 months ago

PC-Admin commented 10 months ago

Good evening,

Awesome looking project, thank you for sharing it. I configured this program successfully and can see the Prometheus metrics at http://10.1.45.201:3002/metrics on my local network.

But when I attempt to add this address as a Prometheus source in Grafana it gives me the error: "404 Not Found - There was an error returned querying the Prometheus API."

When probing the service logs of Grafana it gives me a more detailed error message which claims that the "build info" wasn't found:

Dec 05 13:02:14 ceph01 grafana[20418]: logger=tsdb.prometheus t=2023-12-05T13:02:14.616143483Z level=warn msg="Failed to get prometheus buildinfo" err="no build info"
Dec 05 13:02:14 ceph01 grafana[20418]: logger=tsdb.prometheus endpoint=checkHealth pluginId=prometheus dsName=Prometheus dsUID=d258b1b5-0b46-4038-a67b-113b78caf8aa uname=admin t=2023-12-05T13:02:14.616236096Z level=warn msg="Failed to get prometheus heuristics" err="failed to get buildinfo: no build info"
Dec 05 13:02:14 ceph01 grafana[20418]: logger=context userId=1 orgId=1 uname=admin t=2023-12-05T13:02:14.616375657Z level=info msg="Request Completed" method=GET path=/api/datasources/uid/d258b1b5-0b46-4038-a67b-113b78caf8aa/health status=400 remote_addr=10.1.11.92 time_ms=4 duration=4.167211ms size=103 referer=http://10.1.45.201:3003/connections/datasources/edit/d258b1b5-0b46-4038-a67b-113b78caf8aa handler=/api/datasources/uid/:uid/health

Do you perhaps know what's going on here?

PC-Admin commented 10 months ago

Some screeners for context:

Screenshot from 2023-12-05 21-12-45 Screenshot from 2023-12-05 21-12-36

aauren commented 10 months ago

Hey @PC-Admin thanks for trying out the project.

It looks like you're attempting to use the exporter as a data source in Grafana directly. Unfortunately, this won't work. The full stack that you need includes prometheus server.

In order for this stack to work it goes ntopng-exporter <-- scraped by -- prometheus <-- as a data source to -- grafana

By itself the exporter only provides point in time metrics, it relies on a time series database (TSDB) like Prometheus server in order to keep a lot of those point in time metrics so that you are able to make graphs from them. Grafana in this stack is just a visualizer. It doesn't have any sort of storage for TS metrics.

PC-Admin commented 10 months ago

Ahh that explains it, thank you. :)