How to query Grafana Cloud prometheus endpoint from client?

As far as I’m aware, the only way to access data posted to the Grafana Cloud Prometheus endpoint is to query it from a Grafana dashboard.

Is it possible to query the Prometheus endpoint from outside the dashboard?
Or can I re-design my system to query uploaded metrics from any client?

For context, I am trying to share information between multiple clients that are all scraping data and exporting it to Grafana Cloud. I’m trying to get information that will help schedule scrapes between all connected clients such that they do not exceed the API rate limit of an external service. So checking the recent metrics sent to the cloud and checking the origin_prometheus label of those metrics would be really helpful. to achieve this.

That’s not correct. It’s standard prometheus query endpoint, so you can use your favorite programming language and query data from Grafana Cloud. Of course you need correct authentication.

For example curl:

curl \
<basic auth here> \
https://<your prometheus stack domain here>/api/prom/api/v1/query?query=sum(sum_over_time(probe_http_duration_seconds{job=%22prometheus-blackbox-exporter%22}[1h]))
1 Like

To what address or API would I query a GET request for example? Where could I find documentation of the credential payload/parameters?

That’s in your Grafana Cloud portal - you have stack there, where you have Prometheus details, e.g.

auth is “basic auth” - Basic access authentication - Wikipedia
Username is also in Grafana Cloud portal Prometheus details:

Generate correct access cloud policy and token (so that token is your “password”)