Skip to content

Commit 6804d0a

Browse files
authored
Fix Cortex Service Scaling Dashboard for Grafana 11 (#52)
* Fix Cortex Service Scaling for Grafana 11 Signed-off-by: Friedrich Gonzalez <[email protected]> * Update CHANGELOG Signed-off-by: Friedrich Gonzalez <[email protected]> --------- Signed-off-by: Friedrich Gonzalez <[email protected]>
1 parent 410244b commit 6804d0a

File tree

4 files changed

+49
-8
lines changed

4 files changed

+49
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ cortex-mixin.zip
22
cortex-mixin/out
33
cortex-mixin/vendor
44
/test-readme/
5+
.vscode

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## master / unreleased
44
* [CHANGE] Enable shuffle sharding in compactors
55
* [ENHANCEMENT] Configure `-ingester.client.grpc-compression` to be `snappy-block`
6+
* [ENHANCEMENT] Support Grafana 11 in Cortex Service Scaling Dashboard
67

78
## 1.16.1
89
* [CHANGE] Upgrade memcached to 1.6.23-alpine and memcached-exporter to v0.14.2

cortex-mixin/dashboards/dashboard-utils.libsonnet

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,4 +503,42 @@ local utils = import 'mixin-utils/utils.libsonnet';
503503
%s
504504
||| % [title, description],
505505
},
506+
507+
overrideHidden(name)::
508+
{
509+
matcher: {
510+
id: 'byName',
511+
options: name,
512+
},
513+
properties: [
514+
{
515+
id: 'custom.hidden',
516+
value: true,
517+
},
518+
],
519+
},
520+
521+
overrideDisplayName(name, displayName)::
522+
{
523+
matcher: {
524+
id: 'byName',
525+
options: name,
526+
},
527+
properties: [
528+
{
529+
id: 'displayName',
530+
value: displayName,
531+
},
532+
],
533+
},
534+
535+
536+
tablePanel(queries, overrides)::
537+
super.tablePanel(queries, {}) + {
538+
fieldConfig+: {
539+
overrides+: overrides,
540+
},
541+
styles:: null,
542+
},
543+
506544
}

cortex-mixin/dashboards/scaling.libsonnet

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,15 @@ local utils = import 'mixin-utils/utils.libsonnet';
4747
cluster_namespace_deployment:actual_replicas:count{cluster=~"$cluster", namespace=~"$namespace"}
4848
)
4949
|||,
50-
], {
51-
__name__: { alias: 'Cluster', type: 'hidden' },
52-
cluster: { alias: 'Cluster' },
53-
namespace: { alias: 'Namespace' },
54-
deployment: { alias: 'Service' },
55-
reason: { alias: 'Reason' },
56-
Value: { alias: 'Required Replicas', decimals: 0 },
57-
})
50+
], [
51+
$.overrideHidden('__name__'),
52+
$.overrideHidden('Time'),
53+
$.overrideDisplayName('cluster', 'Cluster'),
54+
$.overrideDisplayName('namespace', 'Namespace'),
55+
$.overrideDisplayName('deployment', 'Service'),
56+
$.overrideDisplayName('reason', 'Reason'),
57+
$.overrideDisplayName('Value', 'Required Replicas'),
58+
])
5859
)
5960
),
6061
}

0 commit comments

Comments
 (0)