How to scrape grafana internal metrics with prometheus

Grafana doc at the link below says that “Currently Grafana supports pushing metrics to graphite and exposing them to be scraped by Prometheus.”

http://docs.grafana.org/administration/metrics/

I set “enabled = true” at metrics section in grafana.ini then scraped at /api/metrics. I get the followings:

{
“alerting.active_alerts”: {
“value”: 0
},
“alerting.execution_time”: {
“count”: 0,
“max”: 0,
“mean”: 0,
“min”: 0,
“p25”: 0,
“p75”: 0,
“p90”: 0,
“p99”: 0,
“std”: 0
},

I set prometheus to scrape the above with metrics_path: /api/metrics. prometheus returns error (target is down) with the following message:

“text format parsing error in line 1: invalid metric name”

Please let me know what is wrong with my setting or alternative method to monitor grafana with prometheus.

You need to upgrade to grafana v4.6 the prometheus metrics can be found at the standard /metrics endpoint

1 Like