I have a bunch of existing SLOs with dashboards and alerts. Currently they are essentially Success metric=all 2xx responses
Total metric = all responses
. We are deciding if we should be excluding 4xx responses from the Total metric
so would like to have a dropdown on the dashboard to switch whether they are included.
Following advice from Grot AI and Chat GPT - I added a Custom variable to the dashboard which had two differet regex values and then added it to the Total Metric (http_server_duration_milliseconds_count{job="specific/component",http_status_code=~"$include_4xx"}
where include_4xx
is the literal regex. It’s crude but works for the dashboard
My question is, presumably include_4xx
won’t be set outside the context of the dashboard, such as when calculating whether to send an SLO alert. What will happen here? Will it just fail? Or have I misunderstood how the dashboards/alerts work?