Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix regex syntax when generating queries using optional _total
  • Loading branch information
emschwartz committed Apr 26, 2023
commit 8d74ac2ded6566fabfe56168b4a34b2d87068e2b
4 changes: 2 additions & 2 deletions autometrics-cli/src/sloth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ fn generate_success_rate_slo(objective_percentile: &str, min_calls_per_second: f
description: Common SLO based on function success rates
sli:
events:
error_query: sum by (objective_name, objective_percentile) (rate({{__name__=~\"function_calls_count(:?_total)?\",objective_percentile=\"{objective_percentile}\",result=\"error\"}}[{{{{.window}}}}]))
total_query: sum by (objective_name, objective_percentile) (rate({{__name__=~\"function_calls_count(:?_total)?\",objective_percentile=\"{objective_percentile}\"}}[{{{{.window}}}}])) >= {min_calls_per_second}
error_query: sum by (objective_name, objective_percentile) (rate({{__name__=~\"function_calls_count(?:_total)?\",objective_percentile=\"{objective_percentile}\",result=\"error\"}}[{{{{.window}}}}]))
total_query: sum by (objective_name, objective_percentile) (rate({{__name__=~\"function_calls_count(?:_total)?\",objective_percentile=\"{objective_percentile}\"}}[{{{{.window}}}}])) >= {min_calls_per_second}
alerting:
name: High Error Rate SLO - {objective_percentile}%
labels:
Expand Down