🌐
Prometheus
prometheus.io › docs › prometheus › latest › querying › api
HTTP API | Prometheus
The following example formats the expression foo/bar: curl 'http://localhost:9090/api/v1/format_query?query=foo/bar' ... This endpoint is experimental and might change in the future. It is currently only meant to be used by Prometheus' own web UI, and the endpoint name and exact format returned ...
🌐
Last9
last9.io › blog › prometheus-api
Prometheus HTTP API: Query and Manage Metrics (2026) | Last9
March 6, 2025 - For query performance specifically, add a stats=1 parameter to your query to get detailed information about how long each step took. For example: http://prometheus:9090/api/v1/query?query=up&stats=1
Discussions

Does someone know how to monitor API endpoints written in Go with Prometheus?
It shouldn’t matter what the underlying language is because you’re ostensibly creating an API that Prometheus is scraping via HTTP. Have you looked at the logs? Can you curl the endpoints manually? More on reddit.com
🌐 r/devops
8
2
September 25, 2023
create a report from Prometheus via curl
Hi I'm trying to create a report from Prometheus via curl. When I run the the following command (via script): curl -v -s -H "Content-Type… More on reddit.com
🌐 r/PrometheusMonitoring
3
2
December 3, 2020
Need some example of 'remote write receiver' HTTP API request in Prometheus
I am trying to find a working example of how to use the remote write receiver in Prometheus. Link : https://prometheus.io/docs/prometheus/latest/querying/api/#remote-write-receiver More on reddit.com
🌐 r/PrometheusMonitoring
1
0
June 1, 2022
Defining the metrics path in Python client.
I'm not a python expert, but the simplest way for me would be to create a Flask app. https://prometheus.github.io/client_python/exporting/http/flask/ More on reddit.com
🌐 r/PrometheusMonitoring
2
2
June 26, 2024
🌐
Last9
last9.io › blog › prometheus-api-guide
An Easy and Comprehensive Guide to Prometheus API | Last9
March 27, 2025 - ... When you need metrics over time (like for graphs), this is your go-to. ... curl 'http://localhost:9090/api/v1/query_range?query=rate(http_requests_total[5m])&start=2023-01-01T20:10:30.781Z&end=2023-01-01T20:11:00.781Z&step=15s'
🌐
Rust
docs.rs › prometheus-http-query
prometheus_http_query - Rust
For example, this may happen when an intermediate proxy server fails to handle a request and subsequently return a plain text error message and a non-2xx HTTP status code. Execute instant and range queries (GET or POST) and properly parse the results (vector/matrix/scalar) ... Some Client methods may not work with older versions of the Prometheus server. The String result type is not supported as it is currently not used by Prometheus. Warnings contained in an API response will be ignored.
🌐
Chronosphere
docs.chronosphere.io › observability platform › tools › prometheus api overview
Prometheus API overview - Chronosphere Documentation
July 30, 2026 - For details, see Service Accounts. A user can access the Prometheus API by creating a temporary personal access token. You can use an API token to make HTTP API calls. For HTTP calls, use the Authorization header with the Bearer token authentication scheme. Example:
🌐
Thomas Suedbroecker
suedbroecker.net › 2022 › 04 › 12 › access-prometheus-queries-using-the-prometheus-rest-api
Access Prometheus queries using the Prometheus HTTP API – Thomas Suedbroecker's Blog
April 12, 2022 - Prometheus gets the counter values over the /metrics endpoint and we will use the Prometheus HTTP API /api/v1/query?query=goobers_total to extract the goobers_total counter values from Prometheus. The GitHub project Go Access Prometheus API contains the example source code related to that blog post.
Find elsewhere
🌐
Alibaba Cloud
alibabacloud.com › help › en › arms › prometheus-monitoring › http-api-urls
Use an HTTP API URL to access Prometheus data in a self-managed Grafana system or a custom application - Application Real-Time Monitoring Service - Alibaba Cloud Documentation Center
March 10, 2026 - The following examples use the /api/v1/query endpoint for instant queries. For range queries (/api/v1/query_range), series metadata, and other endpoints, see the Prometheus HTTP API reference.
🌐
GitHub
github.com › hayk96 › prometheus-api
GitHub - hayk96/prometheus-api: Extended HTTP API service for Prometheus · GitHub
January 13, 2025 - Extended HTTP API service for Prometheus. Contribute to hayk96/prometheus-api development by creating an account on GitHub.
Author: hayk96
🌐
Google
docs.cloud.google.com › google cloud observability › query using the prometheus api or ui
Query using the Prometheus API or UI | Google Cloud Observability | Google Cloud Documentation
As a Google Cloud API, the API uses OAuth2 authentication, and as part of the Cloud Monitoring API, the value of the PROJECT_ID is the scoping project of a metrics scope, so you can retrieve data from any project in the metrics scope. For more information about scoping, see Metrics scopes. To use this endpoint, provide a PromQL expression. For example, the following instant query retrieves all time series that have the metric name up: curl https://monitoring.googleapis.com/v1/projects/PROJECT_ID/location/global/prometheus/api/v1/query \ -d "query=up" \ -H "Authorization: Bearer $(gcloud auth print-access-token)"
🌐
Prometheus
prometheus.io › docs › prometheus › latest › querying › examples
Query examples | Prometheus
Join PromCon EU 2026 , the Prometheus ... case 5 minutes up to the query time) for the same vector, making it a range vector: http_requests_total{job="apiserver", handler="/api/comments"}[5m]...
🌐
Rust
docs.rs › prometheus-http-api
prometheus_http_api - Rust
use prometheus_http_api::{ DataSourceBuilder, InstantQuery, Query, }; #[tokio::main] async fn main() { let query = Query::Instant(InstantQuery::new("up")); let request = DataSourceBuilder::new("localhost:9090") .with_query(query) .build() .unwrap(); let res_json = request.get().await; tracing::info!("{:?}", res_json); }
🌐
Better Stack
betterstack.com › community › questions › how-to-monitor-rest-apis-with-prometheus
How to Monitor REST APIs with Prometheus | Better Stack Community
If you're monitoring external APIs, use Prometheus exporters to fetch and expose data. Install Blackbox Exporter to monitor the availability and latency of REST APIs. ... scrape_configs: - job_name: 'blackbox' metrics_path: /probe params: module: [http_2xx] # Probe for HTTP 200 responses static_configs: - targets: - https://api.example.com relabel_configs: - source_labels: [__address__] target_label: __param_target - source_labels: [__param_target] target_label: instance - target_label: __address__ replacement: blackbox-exporter:9115
🌐
CodeBurst
codeburst.io › prometheus-by-example-4804ab86e741
Prometheus by Example. Exploring Prometheus through a familiar… | by John Tucker | codeburst
December 19, 2020 - ... For example, we use the expression, apache_accesses_total{instance=”apache-exporter:9117", job=”apache”}[1m], to represent the range vector of the time series over the previous minute.
🌐
GitHub
github.com › PayU › prometheus-api-metrics
GitHub - PayU/prometheus-api-metrics: API and process monitoring with Prometheus for Node.js micro-service · GitHub
const axios = require('axios'); const axiosTime = require('axios-time'); axiosTime(axios); try { const response = await axios({ baseURL: 'http://www.google.com', method: 'get', url: '/' }); Collector.collect(response); } catch (error) { Collector.collect(error); } ... In order to collect metrics from axios client the axios-time package is required. This package supports koa server that uses koa-router and koa-bodyparser · const { koaMiddleware } = require('prometheus-api-metrics') app.use(koaMiddleware())
Author: PayU
🌐
Grafana
grafana.com › docs › agent › latest › flow › reference › components › prometheus.receive_http
prometheus.receive_http | Grafana Agent documentation
This example creates a prometheus.receive_http component which starts an HTTP server listening on 0.0.0.0 and port 9999. The server receives metrics and forwards them to a prometheus.remote_write component which writes these metrics to the specified ...
🌐
PyPI
pypi.org › project › prometheus-api-client
prometheus-api-client · PyPI
prom = PrometheusConnect() my_label_config = {'cluster': 'my_cluster_id', 'label_2': 'label_2_value'} prom.get_current_metric_value(metric_name='up', label_config=my_label_config) # Here, we are fetching the values of a particular metric name prom.custom_query(query="prometheus_http_requests_total") # Now, lets try to fetch the `sum` of the metrics prom.custom_query(query="sum(prometheus_http_requests_total)") We can also use custom queries for fetching the metric data in a specific time interval. For example, let's try to fetch the past 2 days of data for a particular metric in chunks of 1 da
      » pip install prometheus-api-client
    
Published: Apr 13, 2026
Version: 0.7.2
🌐
Readthedocs
prometheus-api-client-python.readthedocs.io › en › latest › source › prometheus_api_client.html
prometheus_api_client package — Prometheus Client API Python 0.0.1 documentation
disable_ssl – (bool) If set to True, will disable ssl certificate verification for the http requests made to the prometheus host · retry – (Retry) Retry adapter to retry on HTTP errors · auth – (optional) Auth tuple to enable Basic/Digest/Custom HTTP Auth. See python requests library auth parameter for further explanation. proxy – (Optional) Proxies dictionary to enable connection through proxy. Example: {“http_proxy”: “<ip_address/hostname:port>”, “https_proxy”: “<ip_address/hostname:port>”}