Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Only generate sli when metrics are valid
This prevents low-traffic services from having NaN creeping in the
dashboards/high-level views

Ref: slok/sloth#133 (comment)
  • Loading branch information
Gerry Agbobada committed Mar 27, 2023
commit 1bd54d92d3212e38c0e83bdaaf378020fa61f225
4 changes: 2 additions & 2 deletions autometrics-cli/src/sloth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ fn generate_success_rate_slo(objective_percentile: &str) -> String {
sli:
events:
error_query: sum by (objective_name, objective_percentile) (rate(function_calls_count{{objective_percentile=\"{objective_percentile}\",result=\"error\"}}[{{{{.window}}}}]))
total_query: sum by (objective_name, objective_percentile) (rate(function_calls_count{{objective_percentile=\"{objective_percentile}\"}}[{{{{.window}}}}]))
total_query: sum by (objective_name, objective_percentile) (rate(function_calls_count{{objective_percentile=\"{objective_percentile}\"}}[{{{{.window}}}}])) > 0
alerting:
name: High Error Rate SLO - {objective_percentile}%
labels:
Expand Down Expand Up @@ -87,7 +87,7 @@ fn generate_latency_slo(objective_percentile: &str) -> String {
and
label_join(rate(function_calls_duration_bucket{{objective_percentile=\"{objective_percentile}\"}}[{{{{.window}}}}]), \"autometrics_check_label_equality\", \"\", \"le\")
))
total_query: sum by (objective_name, objective_percentile) (rate(function_calls_duration_count{{objective_percentile=\"{objective_percentile}\"}}[{{{{.window}}}}]))
total_query: sum by (objective_name, objective_percentile) (rate(function_calls_duration_count{{objective_percentile=\"{objective_percentile}\"}}[{{{{.window}}}}])) > 0
alerting:
name: High Latency SLO - {objective_percentile}%
labels:
Expand Down
Loading