|
68 | 68 | "uid": "grafana"
|
69 | 69 | },
|
70 | 70 | "gridPos": {
|
71 |
| - "h": 8, |
72 |
| - "w": 6, |
| 71 | + "h": 5, |
| 72 | + "w": 9, |
73 | 73 | "x": 0,
|
74 | 74 | "y": 0
|
75 | 75 | },
|
|
106 | 106 | "overrides": []
|
107 | 107 | },
|
108 | 108 | "gridPos": {
|
109 |
| - "h": 4, |
110 |
| - "w": 6, |
111 |
| - "x": 6, |
| 109 | + "h": 5, |
| 110 | + "w": 3, |
| 111 | + "x": 9, |
112 | 112 | "y": 0
|
113 | 113 | },
|
114 | 114 | "id": 2,
|
|
143 | 143 | "title": "Total Metrics",
|
144 | 144 | "type": "stat"
|
145 | 145 | },
|
| 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 | + }, |
146 | 227 | {
|
147 | 228 | "datasource": {
|
148 | 229 | "type": "prometheus",
|
|
205 | 286 | ]
|
206 | 287 | },
|
207 | 288 | "gridPos": {
|
208 |
| - "h": 8, |
| 289 | + "h": 16, |
209 | 290 | "w": 12,
|
210 |
| - "x": 12, |
211 |
| - "y": 0 |
| 291 | + "x": 0, |
| 292 | + "y": 5 |
212 | 293 | },
|
213 | 294 | "id": 5,
|
214 | 295 | "options": {
|
|
295 | 376 | "color": {
|
296 | 377 | "mode": "thresholds"
|
297 | 378 | },
|
| 379 | + "custom": { |
| 380 | + "align": "auto", |
| 381 | + "displayMode": "auto", |
| 382 | + "inspect": false |
| 383 | + }, |
298 | 384 | "mappings": [],
|
299 | 385 | "thresholds": {
|
300 | 386 | "mode": "absolute",
|
301 | 387 | "steps": [
|
302 | 388 | {
|
303 | 389 | "color": "green",
|
304 | 390 | "value": null
|
| 391 | + }, |
| 392 | + { |
| 393 | + "color": "#EAB839", |
| 394 | + "value": 0.2 |
| 395 | + }, |
| 396 | + { |
| 397 | + "color": "dark-red", |
| 398 | + "value": 0.5 |
305 | 399 | }
|
306 | 400 | ]
|
307 | 401 | }
|
308 | 402 | },
|
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 | + ] |
310 | 429 | },
|
311 | 430 | "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 |
316 | 435 | },
|
317 |
| - "id": 3, |
| 436 | + "id": 8, |
318 | 437 | "options": {
|
319 |
| - "colorMode": "none", |
320 |
| - "graphMode": "none", |
321 |
| - "justifyMode": "auto", |
322 |
| - "orientation": "auto", |
323 |
| - "reduceOptions": { |
324 |
| - "calcs": [ |
325 |
| - "lastNotNull" |
326 |
| - ], |
| 438 | + "footer": { |
327 | 439 | "fields": "",
|
328 |
| - "values": false |
| 440 | + "reducer": [ |
| 441 | + "sum" |
| 442 | + ], |
| 443 | + "show": false |
329 | 444 | },
|
330 |
| - "textMode": "auto" |
| 445 | + "frameIndex": 1, |
| 446 | + "showHeader": true |
331 | 447 | },
|
332 | 448 | "pluginVersion": "9.1.7",
|
333 | 449 | "targets": [
|
|
337 | 453 | "uid": "$datasource"
|
338 | 454 | },
|
339 | 455 | "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, |
343 | 462 | "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" |
344 | 478 | }
|
345 | 479 | ],
|
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" |
348 | 525 | }
|
349 | 526 | ],
|
350 | 527 | "schemaVersion": 37,
|
|
0 commit comments