Menu
Grafana Cloud
SLO API
Get started with and use the SLO API to create, manage, and maintain your SLOs.
To use the SLO API, complete the following steps.
Create a Grafana API Key with Editor permissions.
Using any HTTP client like
curl
or HTTPie, make calls to the plugin’s “resource” API.- Use “Authentication Bearer: $APITOKEN” and “Accept application/json” as request headers.
- The plugin uses GET to list all SLOs or read a specific one.
- DELETE to delete an individual SLO.
- POST to create an SLO.
- PUT to update an SLO.
For a full definition of the API, download this OpenAPIv3 specification.
Here is an example request body to create an SLO:
json
{
"name":"HTTP Requests Kubelet Success Indicator",
"description":"99.5% of Kubelet HTTP Requests are not 5xx errors",
"objectives":[
{
"value":0.995,
"window":"28d"
}
],
"query":{
"type":"ratio",
"ratio":{
"successMetric":{
"prometheusMetric":"kubelet_http_requests_total{status!~\"5..\"}"
},
"totalMetric":{
"prometheusMetric":"kubelet_http_requests_total"
},
"groupByLabels":[
"instance",
"job"
]
}
},
"alerting":{
"fastBurn":{
"annotations":[
{
"key":"name",
"value":"SLO Burn Rate Very High"
},
{
"key":"description",
"value":"Error budget is burning too fast."
}
]
},
"slowBurn":{
"annotations":[
{
"key":"name",
"value":"SLO Burn Rate High"
},
{
"key":"description",
"value":"Error budget is burning too fast."
}
]
}
}
}
Related resources from Grafana Labs
Additional helpful documentation, links, and articles:

Getting started with your metrics, logs, and traces in Grafana Cloud
Learn to use the best open source observability software (Grafana, Prometheus, Loki, and Tempo) without the overhead of managing and scaling your own stack.

Kubernetes monitoring, out-of-the-box with Grafana Cloud
In this webinar you’ll learn how Grafana offers developers and SREs a simple and quick-to-value solution for monitoring their Kubernetes infrastructure.

Unify your data with Grafana plugins: Datadog, Splunk, MongoDB, and more
In this webinar, learn how to leverage Grafana's plugin ecosystem for access to 80+ data sources, including plugins for Datadog, Splunk, MongoDB, and more.