Skip to content

Commit 2b82c4b

Browse files
ArthurSensroboquat
authored andcommitted
Extend cardinality dashboard with labels information
Signed-off-by: ArthurSens <[email protected]>
1 parent 9bc39df commit 2b82c4b

File tree

1 file changed

+206
-29
lines changed

1 file changed

+206
-29
lines changed

operations/observability/mixins/self-hosted/dashboards/observability/cardinality-management-overview.json

Lines changed: 206 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@
6868
"uid": "grafana"
6969
},
7070
"gridPos": {
71-
"h": 8,
72-
"w": 6,
71+
"h": 5,
72+
"w": 9,
7373
"x": 0,
7474
"y": 0
7575
},
@@ -106,9 +106,9 @@
106106
"overrides": []
107107
},
108108
"gridPos": {
109-
"h": 4,
110-
"w": 6,
111-
"x": 6,
109+
"h": 5,
110+
"w": 3,
111+
"x": 9,
112112
"y": 0
113113
},
114114
"id": 2,
@@ -143,6 +143,87 @@
143143
"title": "Total Metrics",
144144
"type": "stat"
145145
},
146+
{
147+
"datasource": {
148+
"type": "prometheus",
149+
"uid": "$datasource"
150+
},
151+
"fieldConfig": {
152+
"defaults": {
153+
"color": {
154+
"mode": "thresholds"
155+
},
156+
"mappings": [],
157+
"thresholds": {
158+
"mode": "absolute",
159+
"steps": [
160+
{
161+
"color": "green",
162+
"value": null
163+
}
164+
]
165+
}
166+
},
167+
"overrides": []
168+
},
169+
"gridPos": {
170+
"h": 5,
171+
"w": 3,
172+
"x": 12,
173+
"y": 0
174+
},
175+
"id": 3,
176+
"options": {
177+
"colorMode": "none",
178+
"graphMode": "none",
179+
"justifyMode": "auto",
180+
"orientation": "auto",
181+
"reduceOptions": {
182+
"calcs": [
183+
"lastNotNull"
184+
],
185+
"fields": "",
186+
"values": false
187+
},
188+
"textMode": "auto"
189+
},
190+
"pluginVersion": "9.1.7",
191+
"targets": [
192+
{
193+
"datasource": {
194+
"type": "prometheus",
195+
"uid": "$datasource"
196+
},
197+
"editorMode": "code",
198+
"expr": "sum(metric:timeseries_total{cluster=~\"$cluster\"})",
199+
"legendFormat": "__auto",
200+
"range": true,
201+
"refId": "A"
202+
}
203+
],
204+
"title": "Total timeseries",
205+
"type": "stat"
206+
},
207+
{
208+
"datasource": {
209+
"type": "datasource",
210+
"uid": "grafana"
211+
},
212+
"gridPos": {
213+
"h": 5,
214+
"w": 9,
215+
"x": 15,
216+
"y": 0
217+
},
218+
"id": 9,
219+
"options": {
220+
"content": "## Labels with a high number of unique values:\n\n* Could you drop this label entirely?\n\n* Could you decrease the number of unique values for it?\n\n* If you still need this information in this label, could you instead store it in a log file?",
221+
"mode": "markdown"
222+
},
223+
"pluginVersion": "9.1.7",
224+
"title": "💡Tips for labels",
225+
"type": "text"
226+
},
146227
{
147228
"datasource": {
148229
"type": "prometheus",
@@ -205,10 +286,10 @@
205286
]
206287
},
207288
"gridPos": {
208-
"h": 8,
289+
"h": 16,
209290
"w": 12,
210-
"x": 12,
211-
"y": 0
291+
"x": 0,
292+
"y": 5
212293
},
213294
"id": 5,
214295
"options": {
@@ -295,39 +376,74 @@
295376
"color": {
296377
"mode": "thresholds"
297378
},
379+
"custom": {
380+
"align": "auto",
381+
"displayMode": "auto",
382+
"inspect": false
383+
},
298384
"mappings": [],
299385
"thresholds": {
300386
"mode": "absolute",
301387
"steps": [
302388
{
303389
"color": "green",
304390
"value": null
391+
},
392+
{
393+
"color": "#EAB839",
394+
"value": 0.2
395+
},
396+
{
397+
"color": "dark-red",
398+
"value": 0.5
305399
}
306400
]
307401
}
308402
},
309-
"overrides": []
403+
"overrides": [
404+
{
405+
"matcher": {
406+
"id": "byName",
407+
"options": "Percentage of total unique label values"
408+
},
409+
"properties": [
410+
{
411+
"id": "unit",
412+
"value": "percentunit"
413+
},
414+
{
415+
"id": "custom.displayMode",
416+
"value": "gradient-gauge"
417+
},
418+
{
419+
"id": "max",
420+
"value": 1
421+
},
422+
{
423+
"id": "decimals",
424+
"value": 2
425+
}
426+
]
427+
}
428+
]
310429
},
311430
"gridPos": {
312-
"h": 4,
313-
"w": 6,
314-
"x": 6,
315-
"y": 4
431+
"h": 16,
432+
"w": 12,
433+
"x": 12,
434+
"y": 5
316435
},
317-
"id": 3,
436+
"id": 8,
318437
"options": {
319-
"colorMode": "none",
320-
"graphMode": "none",
321-
"justifyMode": "auto",
322-
"orientation": "auto",
323-
"reduceOptions": {
324-
"calcs": [
325-
"lastNotNull"
326-
],
438+
"footer": {
327439
"fields": "",
328-
"values": false
440+
"reducer": [
441+
"sum"
442+
],
443+
"show": false
329444
},
330-
"textMode": "auto"
445+
"frameIndex": 1,
446+
"showHeader": true
331447
},
332448
"pluginVersion": "9.1.7",
333449
"targets": [
@@ -337,14 +453,75 @@
337453
"uid": "$datasource"
338454
},
339455
"editorMode": "code",
340-
"expr": "sum(metric:timeseries_total{cluster=~\"$cluster\"})",
341-
"legendFormat": "__auto",
342-
"range": true,
456+
"exemplar": false,
457+
"expr": "sort_desc(\r\n topk(15, \r\n sum(cardinality_exporter_label_value_count_by_label_name{cluster=~\"$cluster\"}) by (label)\r\n )\r\n)",
458+
"format": "table",
459+
"instant": true,
460+
"legendFormat": "{{label}}",
461+
"range": false,
343462
"refId": "A"
463+
},
464+
{
465+
"datasource": {
466+
"type": "prometheus",
467+
"uid": "$datasource"
468+
},
469+
"editorMode": "code",
470+
"exemplar": false,
471+
"expr": "sort_desc(\r\n topk(15, \r\n sum(cardinality_exporter_label_value_count_by_label_name{cluster=~\"$cluster\"}) by (label) \r\n / \r\n sum(cardinality_exporter_label_value_count_by_label_name{cluster=~\"$cluster\"})\r\n )\r\n)",
472+
"format": "table",
473+
"hide": false,
474+
"instant": true,
475+
"legendFormat": "{{label}}",
476+
"range": false,
477+
"refId": "B"
344478
}
345479
],
346-
"title": "Total timeseries",
347-
"type": "stat"
480+
"title": "Top 10 labels by unique value count",
481+
"transformations": [
482+
{
483+
"id": "seriesToColumns",
484+
"options": {
485+
"byField": "label"
486+
}
487+
},
488+
{
489+
"id": "organize",
490+
"options": {
491+
"excludeByName": {
492+
"Time": true,
493+
"Time 1": true,
494+
"Time 2": true,
495+
"__name__": true,
496+
"cluster": true,
497+
"container": true,
498+
"endpoint": true,
499+
"instance": true,
500+
"job": true,
501+
"namespace": true,
502+
"pod": true,
503+
"prometheus": true,
504+
"prometheus_replica": true,
505+
"service": true
506+
},
507+
"indexByName": {
508+
"Time 1": 4,
509+
"Time 2": 3,
510+
"Value #A": 1,
511+
"Value #B": 2,
512+
"label": 0
513+
},
514+
"renameByName": {
515+
"Value": "Number of unique values",
516+
"Value #A": "Number of timeseries",
517+
"Value #B": "Percentage of total unique label values",
518+
"label": "Label",
519+
"label 1": "Label"
520+
}
521+
}
522+
}
523+
],
524+
"type": "table"
348525
}
349526
],
350527
"schemaVersion": 37,

0 commit comments

Comments
 (0)