Scope metric-based SLO queries

Cette page n'est pas encore disponible en français, sa traduction est en cours.
Si vous avez des questions ou des retours sur notre projet de traduction actuel, n'hésitez pas à nous contacter.
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()

SLO configuration showing example trace metrics

SLO widget

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.

SLO Summary editor with dynamic tags for $env and $availability-zone

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

Documentation, liens et articles supplémentaires utiles:

PREVIEWING: may/unit-testing