From e5987afc0f6539e8aca2e0f1492f433cdebce365 Mon Sep 17 00:00:00 2001 From: Haoyu Sun Date: Tue, 26 Jul 2022 23:05:41 +0200 Subject: [PATCH] add panel Query Concurrency to dashboard mixin. Signed-off-by: Haoyu Sun --- examples/dashboards/query.json | 95 +++++++++++++++++++++++++++++++- mixin/dashboards/query.libsonnet | 10 ++++ 2 files changed, 102 insertions(+), 3 deletions(-) diff --git a/examples/dashboards/query.json b/examples/dashboards/query.json index 4545b2551a..4ffacf8fc5 100644 --- a/examples/dashboards/query.json +++ b/examples/dashboards/query.json @@ -1501,7 +1501,7 @@ "titleSize": "h6" }, { - "collapse": true, + "collapse": false, "height": "250px", "panels": [ { @@ -1510,6 +1510,7 @@ "dashLength": 10, "dashes": false, "datasource": "$datasource", + "description": "Shows available capacity of processing queries in parallel.", "fill": 1, "id": 15, "legend": { @@ -1531,6 +1532,94 @@ "renderer": "flot", "seriesOverrides": [ ], "spaceLength": 10, + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "max_over_time(thanos_query_concurrent_gate_queries_max{job=~\"$job\"}[$__rate_interval]) - avg_over_time(thanos_query_concurrent_gate_queries_in_flight{job=~\"$job\"}[$__rate_interval])", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "{{job}} - {{pod}}", + "legendLink": null, + "step": 10 + } + ], + "thresholds": [ ], + "timeFrom": null, + "timeShift": null, + "title": "Concurrent Capacity", + "tooltip": { + "shared": false, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [ ] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": 0, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ] + } + ], + "repeat": null, + "repeatIteration": null, + "repeatRowId": null, + "showTitle": true, + "title": "Query Concurrency", + "titleSize": "h6" + }, + { + "collapse": true, + "height": "250px", + "panels": [ + { + "aliasColors": { }, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "id": 16, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [ ], + "nullPointMode": "null as zero", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ ], + "spaceLength": 10, "span": 4, "stack": false, "steppedLine": false, @@ -1627,7 +1716,7 @@ "dashes": false, "datasource": "$datasource", "fill": 1, - "id": 16, + "id": 17, "legend": { "avg": false, "current": false, @@ -1703,7 +1792,7 @@ "dashes": false, "datasource": "$datasource", "fill": 1, - "id": 17, + "id": 18, "legend": { "avg": false, "current": false, diff --git a/mixin/dashboards/query.libsonnet b/mixin/dashboards/query.libsonnet index 9a42835b78..5072630653 100644 --- a/mixin/dashboards/query.libsonnet +++ b/mixin/dashboards/query.libsonnet @@ -96,6 +96,16 @@ local utils = import '../lib/utils.libsonnet'; ) ) ) + .addRow( + g.row('Query Concurrency') + .addPanel( + g.panel('Concurrent Capacity', 'Shows available capacity of processing queries in parallel.') + + g.queryPanel( + 'max_over_time(thanos_query_concurrent_gate_queries_max{%s}[$__rate_interval]) - avg_over_time(thanos_query_concurrent_gate_queries_in_flight{%s}[$__rate_interval])' % [thanos.query.dashboard.selector, thanos.query.dashboard.selector], + '{{job}} - {{pod}}' + ) + ) + ) .addRow( g.resourceUtilizationRow(thanos.query.dashboard.selector, thanos.query.dashboard.dimensions) ),