Skip to content

Commit

Permalink
add panel Query Concurrency to dashboard mixin.
Browse files Browse the repository at this point in the history
Signed-off-by: Haoyu Sun <hasun@redhat.com>
  • Loading branch information
raptorsun committed Sep 6, 2022
1 parent b8eb3d8 commit e5987af
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 3 deletions.
95 changes: 92 additions & 3 deletions examples/dashboards/query.json
Original file line number Diff line number Diff line change
Expand Up @@ -1501,7 +1501,7 @@
"titleSize": "h6"
},
{
"collapse": true,
"collapse": false,
"height": "250px",
"panels": [
{
Expand All @@ -1510,6 +1510,7 @@
"dashLength": 10,
"dashes": false,
"datasource": "$datasource",
"description": "Shows available capacity of processing queries in parallel.",
"fill": 1,
"id": 15,
"legend": {
Expand All @@ -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,
Expand Down Expand Up @@ -1627,7 +1716,7 @@
"dashes": false,
"datasource": "$datasource",
"fill": 1,
"id": 16,
"id": 17,
"legend": {
"avg": false,
"current": false,
Expand Down Expand Up @@ -1703,7 +1792,7 @@
"dashes": false,
"datasource": "$datasource",
"fill": 1,
"id": 17,
"id": 18,
"legend": {
"avg": false,
"current": false,
Expand Down
10 changes: 10 additions & 0 deletions mixin/dashboards/query.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -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)
),
Expand Down

0 comments on commit e5987af

Please sign in to comment.