Skip to content

Commit

Permalink
264 freshness sli value denominator using wrong function (#265)
Browse files Browse the repository at this point in the history
* bug: Changed Sum by to count by

* bug: also changed sum to count in prometheus for consistency
  • Loading branch information
georgeowusuHO authored Sep 30, 2022
1 parent a56a05a commit b1df9e5
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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", "(.*)"))
||| % {
Expand Down Expand Up @@ -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],
Expand Down

0 comments on commit b1df9e5

Please sign in to comment.