From 10013fc016483d1483d8785dde0cca0a78fbcf48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gy=C3=B6rgy=20Krajcsovits?= Date: Thu, 4 Apr 2024 15:33:48 +0200 Subject: [PATCH] Use only module.requestPerSecondMetric variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit instead of separate but equal readRequestPerSecondMetric and writeRequestPerSecondMetric Signed-off-by: György Krajcsovits --- .../dashboards/dashboard-queries.libsonnet | 21 +++++++++---------- operations/mimir-mixin/jsonnetfile.lock.json | 4 ++-- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/operations/mimir-mixin/dashboards/dashboard-queries.libsonnet b/operations/mimir-mixin/dashboards/dashboard-queries.libsonnet index 044cbee7d38..228a35784be 100644 --- a/operations/mimir-mixin/dashboards/dashboard-queries.libsonnet +++ b/operations/mimir-mixin/dashboards/dashboard-queries.libsonnet @@ -32,9 +32,8 @@ local utils = import 'mixin-utils/utils.libsonnet'; readRequestsPerSecond: 'cortex_request_duration_seconds_count{%(gatewayMatcher)s, route=~"%(readHTTPRoutesRegex)s"}' % variables, local p = self, - writeRequestsPerSecondMetric: 'cortex_request_duration_seconds', + requestsPerSecondMetric: 'cortex_request_duration_seconds', writeRequestsPerSecondSelector: '%(gatewayMatcher)s, route=~"%(writeHTTPRoutesRegex)s"' % variables, - readRequestsPerSecondMetric: 'cortex_request_duration_seconds', readRequestsPerSecondSelector: '%(gatewayMatcher)s, route=~"%(readHTTPRoutesRegex)s"' % variables, // Write failures rate as percentage of total requests. @@ -51,12 +50,12 @@ local utils = import 'mixin-utils/utils.libsonnet'; sum(%(countQuery)s) |||, classic: template % { - countFailQuery: utils.nativeClassicHistogramCountRate(p.writeRequestsPerSecondMetric, p.writeRequestsPerSecondSelector + ',status_code=~"5.*|error"').classic, - countQuery: utils.nativeClassicHistogramCountRate(p.writeRequestsPerSecondMetric, p.writeRequestsPerSecondSelector).classic, + countFailQuery: utils.nativeClassicHistogramCountRate(p.requestsPerSecondMetric, p.writeRequestsPerSecondSelector + ',status_code=~"5.*|error"').classic, + countQuery: utils.nativeClassicHistogramCountRate(p.requestsPerSecondMetric, p.writeRequestsPerSecondSelector).classic, }, native: template % { - countFailQuery: utils.nativeHistogramCountRate(p.writeRequestsPerSecondMetric, p.writeRequestsPerSecondSelector + ',status_code=~"5.*|error"').native, - countQuery: utils.nativeHistogramCountRate(p.writeRequestsPerSecondMetric, p.writeRequestsPerSecondSelector).native, + countFailQuery: utils.nativeHistogramCountRate(p.requestsPerSecondMetric, p.writeRequestsPerSecondSelector + ',status_code=~"5.*|error"').native, + countQuery: utils.nativeHistogramCountRate(p.requestsPerSecondMetric, p.writeRequestsPerSecondSelector).native, }, }, @@ -89,7 +88,7 @@ local utils = import 'mixin-utils/utils.libsonnet'; writeRequestsPerSecond: 'cortex_request_duration_seconds_count{%(distributorMatcher)s, route=~"%(writeGRPCRoutesRegex)s|%(writeHTTPRoutesRegex)s"}' % variables, local p = self, - writeRequestsPerSecondMetric: 'cortex_request_duration_seconds', + requestsPerSecondMetric: 'cortex_request_duration_seconds', writeRequestsPerSecondSelector: '%(distributorMatcher)s, route=~"%(writeGRPCRoutesRegex)s|%(writeHTTPRoutesRegex)s"' % variables, samplesPerSecond: 'sum(%(groupPrefixJobs)s:cortex_distributor_received_samples:rate5m{%(distributorMatcher)s})' % variables, exemplarsPerSecond: 'sum(%(groupPrefixJobs)s:cortex_distributor_received_exemplars:rate5m{%(distributorMatcher)s})' % variables, @@ -108,12 +107,12 @@ local utils = import 'mixin-utils/utils.libsonnet'; sum(%(countQuery)s) |||, classic: template % { - countFailQuery: utils.nativeClassicHistogramCountRate(p.writeRequestsPerSecondMetric, p.writeRequestsPerSecondSelector + ',status_code=~"5.*|error"').classic, - countQuery: utils.nativeClassicHistogramCountRate(p.writeRequestsPerSecondMetric, p.writeRequestsPerSecondSelector).classic, + countFailQuery: utils.nativeClassicHistogramCountRate(p.requestsPerSecondMetric, p.writeRequestsPerSecondSelector + ',status_code=~"5.*|error"').classic, + countQuery: utils.nativeClassicHistogramCountRate(p.requestsPerSecondMetric, p.writeRequestsPerSecondSelector).classic, }, native: template % { - countFailQuery: utils.nativeClassicHistogramCountRate(p.writeRequestsPerSecondMetric, p.writeRequestsPerSecondSelector + ',status_code=~"5.*|error"').native, - countQuery: utils.nativeClassicHistogramCountRate(p.writeRequestsPerSecondMetric, p.writeRequestsPerSecondSelector).native, + countFailQuery: utils.nativeClassicHistogramCountRate(p.requestsPerSecondMetric, p.writeRequestsPerSecondSelector + ',status_code=~"5.*|error"').native, + countQuery: utils.nativeClassicHistogramCountRate(p.requestsPerSecondMetric, p.writeRequestsPerSecondSelector).native, }, }, }, diff --git a/operations/mimir-mixin/jsonnetfile.lock.json b/operations/mimir-mixin/jsonnetfile.lock.json index 3cad418eca0..eb7c7fcc195 100644 --- a/operations/mimir-mixin/jsonnetfile.lock.json +++ b/operations/mimir-mixin/jsonnetfile.lock.json @@ -8,7 +8,7 @@ "subdir": "grafana-builder" } }, - "version": "7561fd330312538d22b00e0c7caecb4ba66321ea", + "version": "f95501009c9b29bed87fe9d57c1a6e72e210f137", "sum": "+z5VY+bPBNqXcmNAV8xbJcbsRA+pro1R3IM7aIY8OlU=" }, { @@ -18,7 +18,7 @@ "subdir": "mixin-utils" } }, - "version": "7561fd330312538d22b00e0c7caecb4ba66321ea", + "version": "f95501009c9b29bed87fe9d57c1a6e72e210f137", "sum": "0jg7qc3N8FtMnnQbunYCGSNcjHr9Y1krZW9OSTmWcEQ=" } ],