Scope metric-based SLO queries
This feature is only available for metric-based SLO queries.
Overview
The SLO widget supports advanced metric query filtering, including the use of template variables to dynamically scope results displayed.
Walk through of an SLO query
Metric-based SLO query
First, create a metric-based SLO. This example uses APM trace metrics to measure the availability of an example service called web-store
.
Good events (numerator)
sum:trace.rack.request.hits{service:web-store} by {resource_name}.as_count()
sum:trace.rack.request.errors{service:web-store} by {resource_name}.as_count()
Total events (denominator)
sum:trace.rack.request.hits{service:web-store} by {resource_name}.as_count()
Select the SLO in the SLO widget editor. You can apply additional filters in the widget configuration to further scope the results displayed. This does not modify the original definition of the SLO. In the example, we add the $env
and $availability-zone
tags to the filter by field of the widget.
With this configuration, what happens when the Dashboard template variable is changed to env:prod
and availability-zone:northcentralus
?
The SLO widget filters the SLO metric queries by those additional tags for your visualization purposes:
Good events (numerator)
sum:trace.rack.request.hits{service:web-store, env:prod, availability-zone:northcentralus} by {resource_name}.as_count()
sum:trace.rack.request.errors{service:web-store, env:prod, availability-zone:northcentralus} by {resource_name}.as_count()
Total events (denominator)
sum:trace.rack.request.hits{service:web-store, env:prod, availability-zone:northcentralus} by {resource_name}.as_count()
Further reading
Additional helpful documentation, links, and articles: