Skip to main content

Self-hosted Grafana

To build custom dashboards from CoreWeave's Prometheus metrics, deploy a Grafana instance with CoreWeave Apps and connect to CoreWeave Cloud's Prometheus service. Our Prometheus scraping service offers many useful billing metrics for use in self-hosted Grafana instances.

If you have an on-premise Grafana instance, jump to the Connect to Prometheus section.

Deploy Grafana with CoreWeave Apps

Navigate to CoreWeave Applications, then click Catalog.

Search for Grafana, then click the application.

Click Deploy in the upper-right corner and give it a meaningful name.

In most cases, leave Expose to the Public via Ingress selected.

Click Deploy.

Wait for the Pods to deploy, then click the Ingress URL to log in with the username and password in the upper-right corner.

Connect to Prometheus

These steps apply to both Grafana deployed from CoreWeave Apps, and on-premise instances.

In the Grafana instance, go to Configuration -> Data Sources in the lower left menu.

Click Add New Data Source and select Prometheus.

Set the Name to something meaningful, such as CoreWeave Metrics or Legacy CoreWeave Metrics.

Set the URL according to the desired data source:

Data sourceURL
CoreWeave Metrics (current data)https://prometheus.ord1.coreweave.com
Legacy CoreWeave Metrics (older data)https://prometheus-legacy.ord1.coreweave.com
Historical data

For queries that require historical data collected prior to October 21, 2024, we recommend first querying the https://prometheus.ord1.coreweave.com endpoint, as it is significantly more performant. If the returned data contains significant gaps, validate the same query against the https://prometheus-legacy.ord1.coreweave.com endpoint.

Click Add Header in the Custom HTTP Headers section.

Set the following values for Custom HTTP Header.

  • Header: Authorization
  • Value: Bearer [my-token]

Replace [my-token] with the API access token from kubeconfig for the desired Namespace, or generate a new one on the API Access page. The API access token is REDACTED in the previous screenshot.

Tip

There's no need to filter the namespace label to the namespace for any metric. It will be automatically inserted on all queries received.

Click Save & Test at the bottom of the page to verify and save the new data source.

Use the Data Source dropdown menu in Grafana dashboards to view available Data Sources and select which one to visualize in the dashboard.

Build your first dashboard at Grafana Labs is a good quickstart guide for Grafana. For more information about the Prometheus scraping service, refer to the Metrics article.

Connect to Loki

The procedure to connect a CoreWeave Apps Grafana instance to Loki is the same as described in the previous section, except using the Loki data source.

In the Grafana instance, go to Configuration -> Data Sources in the lower left menu.

Click Add New Data Source and select Loki.

Set the Name to something meaningful, such as CoreWeave Loki.

Set the URL to https://prometheus.ord1.coreweave.com. Use this URL regardless of the dates queried.

Click Add Header in the Custom HTTP Headers section.

Set the following values for Custom HTTP Header.

  • Header: Authorization
  • Value: Bearer [my-token]

Replace [my-token] with the API access token from kubeconfig for the desired Namespace, or generate a new one on the API Access page.

Click Save & Test at the bottom of the page to verify and save the new Data Source.

Choose the new Data Source in a dashboard to query the Loki logs for your CoreWeave Namespace.

For more details about constructing queries with Loki, see the LogQL documentation.