From b1df9e5c1dbe02acc12eb682273a65c9771c164a Mon Sep 17 00:00:00 2001 From: George Owusu <110245370+georgeowusuHO@users.noreply.github.com> Date: Fri, 30 Sep 2022 11:34:31 +0100 Subject: [PATCH] 264 freshness sli value denominator using wrong function (#265) * bug: Changed Sum by to count by * bug: also changed sum to count in prometheus for consistency --- .../average-freshness-using-queue-metric.libsonnet | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monitoring-as-code/src/sli-value-libraries/average-freshness-using-queue-metric.libsonnet b/monitoring-as-code/src/sli-value-libraries/average-freshness-using-queue-metric.libsonnet index da804ec9..6a92c475 100644 --- a/monitoring-as-code/src/sli-value-libraries/average-freshness-using-queue-metric.libsonnet +++ b/monitoring-as-code/src/sli-value-libraries/average-freshness-using-queue-metric.libsonnet @@ -37,7 +37,7 @@ local createSliValueRule(sliSpec, sliMetadata, config) = ( sum by(%(selectorLabels)s) (avg_over_time((%(oldestMessageMetric)s{%(selectors)s, %(queueSelector)s} > bool %(latencyTarget)s)[%(evalInterval)s:%(evalInterval)s])) / - sum by(%(selectorLabels)s) (count_over_time(%(oldestMessageMetric)s{%(selectors)s, %(queueSelector)s}[%(evalInterval)s])) + count by(%(selectorLabels)s) (count_over_time(%(oldestMessageMetric)s{%(selectors)s, %(queueSelector)s}[%(evalInterval)s])) ), "sli_environment", "$1", "%(environmentSelectorLabel)s", "(.*)"), "sli_product", "$1", "%(productSelectorLabel)s", "(.*)")) ||| % { @@ -91,7 +91,7 @@ local createGraphPanel(sliSpec) = ||| sum(avg_over_time((%(oldestMessageMetric)s{%(selectors)s, %(queueSelector)s} > bool %(latencyTarget)s)[%(evalInterval)s:%(evalInterval)s]) or vector(0)) / - sum(count_over_time(%(oldestMessageMetric)s{%(selectors)s, %(queueSelector)s}[%(evalInterval)s])) + count(count_over_time(%(oldestMessageMetric)s{%(selectors)s, %(queueSelector)s}[%(evalInterval)s])) ||| % { oldestMessageMetric: targetMetrics.oldestMessage, queueSelector: '%s!~"%s"' % [metricConfig.customSelectorLabels.deadletterQueueName, metricConfig.customSelectors.deadletterQueueName],