PromQL examples for SLO data
These examples query the public metric schema with PromQL. Run them against the base URL with authentication, or paste the expressions into a Grafana panel backed by the Prometheus API data source.
Replace my-project and my-slo with your own values. To find them, list label values with the
/label/{label_name}/values endpoint.
A 60-second PromQL primer
- Select a metric by name:
reliability. Every Nobl9 metric is agauge. - Filter with labels in braces:
reliability{project="my-project",slo="my-slo"}. Use=,!=,=~(regex), and!~. - Instant vs range. An instant query returns the latest value per series; a range query
returns a value per
stepover a time window. - Functions over time need a range selector in brackets:
avg_over_time(burn_rate{...}[24h]). - Aggregate across series with
sum,avg,count,min,max,topk,bottomk, optionally grouped withby (label). - Compare and compute with operators:
budget{...} < 0.2,1 - budget{...}.
For the full language, see the official PromQL documentation.
Simple examples
Remaining error budget of an objective (1 = 100% remaining, negative = overspent):
budget{project="my-project",slo="my-slo"}
Current reliability of an objective (ratio from 0 to 1):
reliability{project="my-project",slo="my-slo"}
Current burn rate (1 = burning budget at exactly the sustainable rate):
burn_rate{project="my-project",slo="my-slo"}
Good and total counts in the current window:
count_good{project="my-project",slo="my-slo"}
count_total{project="my-project",slo="my-slo"}
Advanced examples
These show how a single PromQL expression can answer open-ended questions across many SLOs at once.
Which objectives in a project have less than 20% budget left?
budget{project="my-project"} < 0.2
The result contains only the objectives whose budget is below the threshold, each labeled with
its slo, objective, and service.
What percentage of an objective's error budget has been burned?
(1 - budget{project="my-project",slo="my-slo"}) * 100
Which five objectives are the least reliable right now?
bottomk(5, reliability{project="my-project"})
Which five objectives burned budget the fastest over the last hour?
burn_rate is volatile from sample to sample, so rank by its average over a window rather than the
instant value:
topk(5, avg_over_time(burn_rate{project="my-project"}[1h]))
How many objectives burned faster than the sustainable rate over the last hour?
count(avg_over_time(burn_rate{project="my-project"}[1h]) > 1)
Which objectives are currently below their target?
This compares each objective's reliability against its own target, matching the two metrics on
their shared labels:
reliability{project="my-project"}
< on(project, slo, objective, service)
target{project="my-project"}
How many objectives does a project have?
count by (project) (reliability{project="my-project"})
This counts only objectives that currently have reliability samples; objectives with no recent
data aren't included.
What is the good-to-total ratio per objective?
count_good{project="my-project"} / count_total{project="my-project"}
How has reliability trended over the last six hours?
Use a range query with avg_over_time and a step:
avg_over_time(reliability{project="my-project",slo="my-slo"}[1h])
curl --globoff -u 'clientId:clientSecret' \
'https://app.nobl9.com/api/prometheus/v1/api/v1/query_range' \
--data-urlencode 'query=avg_over_time(reliability{project="my-project",slo="my-slo"}[1h])' \
--data-urlencode 'start=2026-05-29T00:00:00Z' \
--data-urlencode 'end=2026-05-29T06:00:00Z' \
--data-urlencode 'step=1h'
Broad queries can exceed the query limits (for example,
selecting more than 1,000 series). Add label matchers such as project or slo to narrow the
result set.