Metrics
Fully managed Prometheus metrics available for your cloud environment.
On CoreWeave, a wide range of Prometheus metrics are made available by default. The following guides presume that you already have an active CoreWeave account including a functioning API Access Token.
Once logged in to your CoreWeave Cloud account, visit the Prometheus dashboard at https://prometheus.ord1.coreweave.com.
API key authentication
To authenticate using HTTP, access the Prometheus server by sending your Access Token as the Authorization Header value in the HTTP request.
Replace <TOKEN>
with your CoreWeave Access Token.
Parameter | Value |
---|---|
Methods | GET or POST |
Header | Authorization |
Value | Bearer <TOKEN> |
Selecting a Data Source
For the URL
parameter, select the appropriate endpoint for the target date range:
URL | Date |
---|---|
https://prometheus.ord1.coreweave.com/ | CoreWeave Metrics (current data) |
https://prometheus-legacy.ord1.coreweave.com/ | Legacy CoreWeave Metrics (older data) |
For queries that require historical data collected prior to October 21, 2024, we recommend first querying the current Prometheus endpoint, as it is significantly more performant. If the returned data contains significant gaps, validate the same query against the Legacy Prometheus system.
Example Prometheus query using an Access Token
POST
https://prometheus.ord1.coreweave.com/api/v1/query
Example usage for sending a request to the Prometheus API using your Access Token.
Query Parameters
Name | Type | Description |
---|---|---|
time | number | Unix timestamp of current time |
query | string | The PromQL Query (kube_pod_container_info ) |
Headers
Name | Type | Description |
---|---|---|
Authorization | string | Set value to Bearer <TOKEN> as the value, replacing <TOKEN> with your CoreWeave Access Token. |
Example request
$curl -X POST 'https://prometheus.ord1.coreweave.com/api/v1/query?time=<UNIX_TIMESTAMP>&query=<PROMQL_QUERY>' \-H 'Authorization: Bearer <TOKEN>'
Responses
Value | Type | Description |
---|---|---|
200 | number | Success |
Example Prometheus response data:
{"status": "success","data": {"resultType": "vector","result": [{"metric": {"__name__": "kube_pod_container_info","container": "example","container_id": "docker://1548c7ce5d717cfb9e3e797464d9fe4fbda0cea6f324fda8b9b64b2f5fd44e2f","endpoint": "http","image": "example/example_image:1.6.4","image_id": "docker-pullable://docker-registry-image","instance": "10.0.0.1:8080","job": "kube-state-metrics","namespace": "tenant-example","pod": "example-5d796977bc-crk9m","service": "tenant-metrics-kube-state-metrics"},"value": [1629254349.447, "1"]}]}}
Custom metric scraping
CoreWeave's hosted Prometheus service may be used to scrape custom targets using a ServiceMonitor. Annotations from the ServiceMonitor must match the Service hosting the Prometheus exporter endpoint, usually at the path /metrics
.
Below is an example of a Prometheus exporter scraped by the Prometheus service.
The value of .endpoints.port
must be the literal string http
, and may not be replaced with a port number integer (e.g., 80
).
- servicemonitor.yaml
- deployment.yaml
- service.yaml
apiVersion: monitoring.coreos.com/v1kind: ServiceMonitormetadata:name: examplenamespace: tenant-examplelabels:app: examplespec:jobLabel: example-scrapingselector:matchLabels:app: examplenamespaceSelector:matchNames:- tenant-exampleendpoints:- port: httpscheme: httppath: /metricsinterval: 15sscrapeTimeout: 15s
apiVersion: apps/v1kind: Deploymentmetadata:name: examplenamespace: tenant-examplelabels:app: examplespec:replicas: 1selector:matchLabels:app: exampletemplate:metadata:labels:app: examplespec:containers:- name: exampleimage: "infinityworks/docker-hub-exporter:latest"imagePullPolicy: Alwaysenv:- name: ORGvalue: coreweave #replace with your orgports:- name: httpcontainerPort: 9170protocol: TCP
apiVersion: v1kind: Servicemetadata:name: examplenamespace: tenant-examplelabels:app: examplespec:type: ClusterIPports:- port: 8080targetPort: 9170protocol: TCPname: httpselector:app: example