Skip to content

Prometheus metrics

OpenWatch exposes your cost and resource figures as Prometheus metrics, so you can scrape them into your own monitoring stack and build dashboards or alerts alongside the rest of your infrastructure.

Endpoint

GET /prometheus/metrics

The endpoint returns metrics in the standard Prometheus text exposition format. It is authenticated with a per-organisation bearer token and is exempt from CSRF (it is a machine-to-machine endpoint that authenticates itself).

Authentication

Each organisation has its own Prometheus token. Pass it in the Authorization header:

Authorization: Bearer <your-token>

Requests without a valid token receive 401 Unauthorized. Because the token scopes the response to a single organisation, keep it secret and rotate it if it leaks.

One token per organisation

The metrics returned are those of the organisation that owns the token. If you run several organisations, scrape each with its own token (and its own Prometheus job or target label).

Scrape configuration

Add a job to your prometheus.yml:

scrape_configs:
  - job_name: openwatch
    scheme: https
    bearer_token: "<your-token>"
    metrics_path: /prometheus/metrics
    static_configs:
      - targets: ["openwatch.example.com"]

Replace the target with your OpenWatch host and the token with your organisation's token.

Metrics exposed

Metric Type Description
openwatch_cost_compute_monthly gauge Estimated monthly compute cost.
openwatch_cost_storage_monthly gauge Estimated monthly storage cost.
openwatch_cost_network_monthly gauge Estimated monthly network cost.
openwatch_cost_total_monthly gauge Estimated monthly total cost.
openwatch_resource_count gauge Number of resources, labelled by type (for example servers, volumes, routers).
openwatch_rightsizing_savings_monthly gauge Estimated monthly savings identified by rightsizing.
openwatch_rightsizing_score gauge Rightsizing efficiency score.
openwatch_rightsizing_recommendations gauge Number of open rightsizing recommendations.

Cost values follow the same figures shown on the cost dashboard. Resource counts mirror the resource explorer.

Freshness

Metrics reflect OpenWatch's cached data, which is refreshed in the background. They are not a live query against your cloud on every scrape, so a short scrape interval will not increase load on your cloud provider.