Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Queries dashboard: allow using cortex_request_duration_seconds native histogram #8800

Merged
merged 2 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
* Rollout progress dashboard. #8779
* Alertmanager dashboard. #8792
* Ruler dashboard: `cortex_request_duration_seconds` metric. #8795
* Queries dashboard: `cortex_request_duration_seconds` metric. #8800
* [ENHANCEMENT] Alerts: `MimirRunningIngesterReceiveDelayTooHigh` alert has been tuned to be more reactive to high receive delay. #8538
* [ENHANCEMENT] Dashboards: improve end-to-end latency and strong read consistency panels when experimental ingest storage is enabled. #8543
* [ENHANCEMENT] Dashboards: Add panels for monitoring ingester autoscaling when not using ingest-storage. These panels are disabled by default, but can be enabled using the `autoscaling.ingester.enabled: true` config option. #8484
Expand Down
1 change: 1 addition & 0 deletions operations/helm/charts/mimir-distributed/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Entries should include a reference to the Pull Request that introduced the chang
* Rollout progress dashboard. #8779
* Alertmanager dashboard. #8792
* Ruler dashboard: `cortex_request_duration_seconds` metric. #8795
* Queries dashboard: `cortex_request_duration_seconds` metric. #8800
* [ENHANCEMENT] Memcached: Update to Memcached 1.6.28 and memcached-exporter 0.14.4. #8557
* [ENHANCEMENT] Add missing fields in multiple topology spread constraints. #8533
* [ENHANCEMENT] Add support for setting the image pull secrets, node selectors, tolerations and topology spread constraints for the Grafana Agent pods used for metamonitoring. #8670
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13636,6 +13636,35 @@ data:
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"current": {
"selected": true,
"text": "classic",
"value": "1"
},
"description": "Choose between showing latencies based on low precision classic or high precision native histogram metrics.",
"hide": 0,
"includeAll": false,
"label": "Latency metrics",
"multi": false,
"name": "latency_metrics",
"options": [
{
"selected": false,
"text": "native",
"value": "-1"
},
{
"selected": true,
"text": "classic",
"value": "1"
}
],
"query": "native : -1,classic : 1",
"skipUrlSync": false,
"type": "custom",
"useTags": false
}
]
},
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions operations/mimir-mixin-compiled/dashboards/mimir-queries.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 13 additions & 8 deletions operations/mimir-mixin/dashboards/queries.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ local filename = 'mimir-queries.json';
assert std.md5(filename) == 'b3abe8d5c040395cc36615cb4334c92d' : 'UID of the dashboard has changed, please update references to dashboard.';
($.dashboard('Queries') + { uid: std.md5(filename) })
.addClusterSelectorTemplates()
.addShowNativeLatencyVariable()
.addRow(
$.row('Query-frontend')
.addPanel(
Expand Down Expand Up @@ -235,23 +236,27 @@ local filename = 'mimir-queries.json';
|||
) +
$.queryPanel(
[
local ncSumRate = utils.ncHistogramSumBy(utils.ncHistogramCountRate($.queries.ingester.requestsPerSecondMetric, $.queries.ingester.readRequestsPerSecondSelector));
local scSuccessful =
|||
(
sum(rate(cortex_ingest_storage_strong_consistency_requests_total{%s}[$__rate_interval]))
-
sum(rate(cortex_ingest_storage_strong_consistency_failures_total{%s}[$__rate_interval]))
)
/
sum(rate(cortex_request_duration_seconds_count{%s,route=~"%s"}[$__rate_interval]))
||| % [$.jobMatcher($._config.job_names.ingester), $.jobMatcher($._config.job_names.ingester), $.jobMatcher($._config.job_names.ingester), $._config.ingester_read_path_routes_regex],
||| % [$.jobMatcher($._config.job_names.ingester), $.jobMatcher($._config.job_names.ingester)];
local scFailed =
|||
sum(rate(cortex_ingest_storage_strong_consistency_failures_total{%s}[$__rate_interval]))
/
sum(rate(cortex_request_duration_seconds_count{%s,route=~"%s"}[$__rate_interval]))
||| % [$.jobMatcher($._config.job_names.ingester), $.jobMatcher($._config.job_names.ingester), $._config.ingester_read_path_routes_regex],
||| % [$.jobMatcher($._config.job_names.ingester)];
local scRate(sc, rate) = std.join(' / ', [sc, rate]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically works, but mathematically you'd want to apply util.showClassicHistogramQuery last as it applies to the whole expression. Anyway, that would probably make it more complicated.

[
scRate(scSuccessful, utils.showClassicHistogramQuery(ncSumRate)),
scRate(scSuccessful, utils.showNativeHistogramQuery(ncSumRate)),
scRate(scFailed, utils.showClassicHistogramQuery(ncSumRate)),
scRate(scFailed, utils.showNativeHistogramQuery(ncSumRate)),
],
['successful', 'failed'],
['successful', 'successful', 'failed', 'failed'],
)
+ $.aliasColors({ failed: $._colors.failed, successful: $._colors.success })
+ { fieldConfig+: { defaults+: { unit: 'percentunit', min: 0, max: 1 } } }
Expand Down
Loading