corpus

self-hosted listenbrainz and last.fm proxy
Log | Files | Refs | README | LICENSE

grafana-dashboard.json (13745B)


      1 {
      2 	"title": "Corpus",
      3 	"uid": "corpus",
      4 	"version": 1,
      5 	"schemaVersion": 38,
      6 	"timezone": "browser",
      7 	"refresh": "30s",
      8 	"time": { "from": "now-24h", "to": "now" },
      9 	"templating": { "list": [] },
     10 	"annotations": { "list": [] },
     11 	"panels": [
     12 		{
     13 			"id": 1,
     14 			"type": "row",
     15 			"title": "HTTP",
     16 			"gridPos": { "x": 0, "y": 0, "w": 24, "h": 1 },
     17 			"collapsed": false
     18 		},
     19 		{
     20 			"id": 2,
     21 			"type": "timeseries",
     22 			"title": "Request Rate",
     23 			"gridPos": { "x": 0, "y": 1, "w": 12, "h": 8 },
     24 			"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
     25 			"targets": [
     26 				{
     27 					"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
     28 					"expr": "sum by (method, path, status) (rate(corpus_http_requests_total[5m]))",
     29 					"legendFormat": "{{method}} {{path}} {{status}}",
     30 					"refId": "A"
     31 				}
     32 			],
     33 			"fieldConfig": {
     34 				"defaults": {
     35 					"unit": "reqps",
     36 					"custom": { "lineWidth": 1, "fillOpacity": 10 }
     37 				},
     38 				"overrides": []
     39 			},
     40 			"options": {
     41 				"tooltip": { "mode": "multi", "sort": "none" },
     42 				"legend": { "displayMode": "list", "placement": "bottom" }
     43 			}
     44 		},
     45 		{
     46 			"id": 3,
     47 			"type": "timeseries",
     48 			"title": "Request Duration (p50 / p90 / p99)",
     49 			"gridPos": { "x": 12, "y": 1, "w": 12, "h": 8 },
     50 			"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
     51 			"targets": [
     52 				{
     53 					"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
     54 					"expr": "histogram_quantile(0.50, sum by (le, path) (rate(corpus_http_request_duration_seconds_bucket[5m])))",
     55 					"legendFormat": "p50 {{path}}",
     56 					"refId": "A"
     57 				},
     58 				{
     59 					"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
     60 					"expr": "histogram_quantile(0.90, sum by (le, path) (rate(corpus_http_request_duration_seconds_bucket[5m])))",
     61 					"legendFormat": "p90 {{path}}",
     62 					"refId": "B"
     63 				},
     64 				{
     65 					"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
     66 					"expr": "histogram_quantile(0.99, sum by (le, path) (rate(corpus_http_request_duration_seconds_bucket[5m])))",
     67 					"legendFormat": "p99 {{path}}",
     68 					"refId": "C"
     69 				}
     70 			],
     71 			"fieldConfig": {
     72 				"defaults": {
     73 					"unit": "s",
     74 					"custom": { "lineWidth": 1, "fillOpacity": 10 }
     75 				},
     76 				"overrides": []
     77 			},
     78 			"options": {
     79 				"tooltip": { "mode": "multi", "sort": "none" },
     80 				"legend": { "displayMode": "list", "placement": "bottom" }
     81 			}
     82 		},
     83 		{
     84 			"id": 10,
     85 			"type": "row",
     86 			"title": "Sync",
     87 			"gridPos": { "x": 0, "y": 9, "w": 24, "h": 1 },
     88 			"collapsed": false
     89 		},
     90 		{
     91 			"id": 11,
     92 			"type": "timeseries",
     93 			"title": "Sync Runs (per hour)",
     94 			"gridPos": { "x": 0, "y": 10, "w": 8, "h": 8 },
     95 			"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
     96 			"targets": [
     97 				{
     98 					"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
     99 					"expr": "increase(corpus_sync_runs_total[1h])",
    100 					"legendFormat": "{{user}} {{source}} {{result}}",
    101 					"refId": "A"
    102 				}
    103 			],
    104 			"fieldConfig": {
    105 				"defaults": {
    106 					"unit": "short",
    107 					"custom": { "lineWidth": 1, "fillOpacity": 10 }
    108 				},
    109 				"overrides": []
    110 			},
    111 			"options": {
    112 				"tooltip": { "mode": "multi", "sort": "none" },
    113 				"legend": { "displayMode": "list", "placement": "bottom" }
    114 			}
    115 		},
    116 		{
    117 			"id": 12,
    118 			"type": "timeseries",
    119 			"title": "Scrobbles Added (per hour)",
    120 			"gridPos": { "x": 8, "y": 10, "w": 8, "h": 8 },
    121 			"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
    122 			"targets": [
    123 				{
    124 					"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
    125 					"expr": "increase(corpus_sync_scrobbles_added_total[1h])",
    126 					"legendFormat": "{{user}} {{source}}",
    127 					"refId": "A"
    128 				}
    129 			],
    130 			"fieldConfig": {
    131 				"defaults": {
    132 					"unit": "short",
    133 					"custom": { "lineWidth": 1, "fillOpacity": 10 }
    134 				},
    135 				"overrides": []
    136 			},
    137 			"options": {
    138 				"tooltip": { "mode": "multi", "sort": "none" },
    139 				"legend": { "displayMode": "list", "placement": "bottom" }
    140 			}
    141 		},
    142 		{
    143 			"id": 13,
    144 			"type": "stat",
    145 			"title": "Time Since Last Sync",
    146 			"gridPos": { "x": 16, "y": 10, "w": 4, "h": 4 },
    147 			"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
    148 			"targets": [
    149 				{
    150 					"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
    151 					"expr": "time() - corpus_sync_last_success_seconds",
    152 					"legendFormat": "{{user}} {{source}}",
    153 					"refId": "A",
    154 					"instant": true
    155 				}
    156 			],
    157 			"fieldConfig": {
    158 				"defaults": {
    159 					"unit": "dtdurations",
    160 					"thresholds": {
    161 						"mode": "absolute",
    162 						"steps": [
    163 							{ "color": "green", "value": null },
    164 							{ "color": "yellow", "value": 3600 },
    165 							{ "color": "red", "value": 86400 }
    166 						]
    167 					},
    168 					"color": { "mode": "thresholds" }
    169 				},
    170 				"overrides": []
    171 			},
    172 			"options": {
    173 				"reduceOptions": { "calcs": ["lastNotNull"] },
    174 				"orientation": "auto",
    175 				"textMode": "auto",
    176 				"colorMode": "value",
    177 				"graphMode": "none"
    178 			}
    179 		},
    180 		{
    181 			"id": 14,
    182 			"type": "stat",
    183 			"title": "Time Since Last Backup",
    184 			"gridPos": { "x": 20, "y": 10, "w": 4, "h": 4 },
    185 			"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
    186 			"targets": [
    187 				{
    188 					"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
    189 					"expr": "time() - corpus_db_backup_last_success_seconds",
    190 					"legendFormat": "{{user}}",
    191 					"refId": "A",
    192 					"instant": true
    193 				}
    194 			],
    195 			"fieldConfig": {
    196 				"defaults": {
    197 					"unit": "dtdurations",
    198 					"thresholds": {
    199 						"mode": "absolute",
    200 						"steps": [
    201 							{ "color": "green", "value": null },
    202 							{ "color": "yellow", "value": 86400 },
    203 							{ "color": "red", "value": 172800 }
    204 						]
    205 					},
    206 					"color": { "mode": "thresholds" }
    207 				},
    208 				"overrides": []
    209 			},
    210 			"options": {
    211 				"reduceOptions": { "calcs": ["lastNotNull"] },
    212 				"orientation": "auto",
    213 				"textMode": "auto",
    214 				"colorMode": "value",
    215 				"graphMode": "none"
    216 			}
    217 		},
    218 		{
    219 			"id": 15,
    220 			"type": "stat",
    221 			"title": "Total Backup Runs",
    222 			"gridPos": { "x": 16, "y": 14, "w": 4, "h": 4 },
    223 			"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
    224 			"targets": [
    225 				{
    226 					"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
    227 					"expr": "corpus_db_backup_runs_total",
    228 					"legendFormat": "{{user}}",
    229 					"refId": "A",
    230 					"instant": true
    231 				}
    232 			],
    233 			"fieldConfig": {
    234 				"defaults": {
    235 					"unit": "short",
    236 					"color": { "mode": "fixed", "fixedColor": "blue" }
    237 				},
    238 				"overrides": []
    239 			},
    240 			"options": {
    241 				"reduceOptions": { "calcs": ["lastNotNull"] },
    242 				"orientation": "auto",
    243 				"textMode": "auto",
    244 				"colorMode": "value",
    245 				"graphMode": "none"
    246 			}
    247 		},
    248 		{
    249 			"id": 16,
    250 			"type": "stat",
    251 			"title": "Total Sync Runs",
    252 			"gridPos": { "x": 20, "y": 14, "w": 4, "h": 4 },
    253 			"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
    254 			"targets": [
    255 				{
    256 					"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
    257 					"expr": "sum by (source) (corpus_sync_runs_total)",
    258 					"legendFormat": "{{source}}",
    259 					"refId": "A",
    260 					"instant": true
    261 				}
    262 			],
    263 			"fieldConfig": {
    264 				"defaults": {
    265 					"unit": "short",
    266 					"color": { "mode": "fixed", "fixedColor": "blue" }
    267 				},
    268 				"overrides": []
    269 			},
    270 			"options": {
    271 				"reduceOptions": { "calcs": ["lastNotNull"] },
    272 				"orientation": "auto",
    273 				"textMode": "auto",
    274 				"colorMode": "value",
    275 				"graphMode": "none"
    276 			}
    277 		},
    278 		{
    279 			"id": 20,
    280 			"type": "row",
    281 			"title": "Enrichment",
    282 			"gridPos": { "x": 0, "y": 18, "w": 24, "h": 1 },
    283 			"collapsed": false
    284 		},
    285 		{
    286 			"id": 21,
    287 			"type": "timeseries",
    288 			"title": "Enrichment Fetches (per hour)",
    289 			"gridPos": { "x": 0, "y": 19, "w": 12, "h": 8 },
    290 			"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
    291 			"targets": [
    292 				{
    293 					"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
    294 					"expr": "increase(corpus_enrichment_fetches_total[1h])",
    295 					"legendFormat": "{{user}} {{source}} {{result}}",
    296 					"refId": "A"
    297 				}
    298 			],
    299 			"fieldConfig": {
    300 				"defaults": {
    301 					"unit": "short",
    302 					"custom": { "lineWidth": 1, "fillOpacity": 10 }
    303 				},
    304 				"overrides": []
    305 			},
    306 			"options": {
    307 				"tooltip": { "mode": "multi", "sort": "none" },
    308 				"legend": { "displayMode": "list", "placement": "bottom" }
    309 			}
    310 		},
    311 		{
    312 			"id": 22,
    313 			"type": "timeseries",
    314 			"title": "Enrichment Queue Size",
    315 			"gridPos": { "x": 12, "y": 19, "w": 12, "h": 8 },
    316 			"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
    317 			"targets": [
    318 				{
    319 					"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
    320 					"expr": "corpus_enrichment_queue_size",
    321 					"legendFormat": "{{user}} {{type}}",
    322 					"refId": "A"
    323 				}
    324 			],
    325 			"fieldConfig": {
    326 				"defaults": {
    327 					"unit": "short",
    328 					"min": 0,
    329 					"custom": { "lineWidth": 1, "fillOpacity": 10 },
    330 					"thresholds": {
    331 						"mode": "absolute",
    332 						"steps": [
    333 							{ "color": "green", "value": null },
    334 							{ "color": "yellow", "value": 10 },
    335 							{ "color": "red", "value": 100 }
    336 						]
    337 					}
    338 				},
    339 				"overrides": []
    340 			},
    341 			"options": {
    342 				"tooltip": { "mode": "multi", "sort": "none" },
    343 				"legend": { "displayMode": "list", "placement": "bottom" }
    344 			}
    345 		},
    346 		{
    347 			"id": 40,
    348 			"type": "row",
    349 			"title": "Cosine Club",
    350 			"gridPos": { "x": 0, "y": 36, "w": 24, "h": 1 },
    351 			"collapsed": false
    352 		},
    353 		{
    354 			"id": 41,
    355 			"type": "timeseries",
    356 			"title": "Cosine Requests (per hour)",
    357 			"gridPos": { "x": 0, "y": 37, "w": 12, "h": 8 },
    358 			"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
    359 			"targets": [
    360 				{
    361 					"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
    362 					"expr": "increase(corpus_cosine_requests_total[1h])",
    363 					"legendFormat": "{{user}} {{result}}",
    364 					"refId": "A"
    365 				}
    366 			],
    367 			"fieldConfig": {
    368 				"defaults": {
    369 					"unit": "short",
    370 					"custom": { "lineWidth": 1, "fillOpacity": 10 }
    371 				},
    372 				"overrides": []
    373 			},
    374 			"options": {
    375 				"tooltip": { "mode": "multi", "sort": "none" },
    376 				"legend": { "displayMode": "list", "placement": "bottom" }
    377 			}
    378 		},
    379 		{
    380 			"id": 42,
    381 			"type": "stat",
    382 			"title": "Cosine Requests by Result",
    383 			"gridPos": { "x": 12, "y": 37, "w": 12, "h": 8 },
    384 			"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
    385 			"targets": [
    386 				{
    387 					"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
    388 					"expr": "sum by (result) (corpus_cosine_requests_total)",
    389 					"legendFormat": "{{result}}",
    390 					"refId": "A",
    391 					"instant": true
    392 				}
    393 			],
    394 			"fieldConfig": {
    395 				"defaults": {
    396 					"unit": "short",
    397 					"color": { "mode": "fixed", "fixedColor": "blue" }
    398 				},
    399 				"overrides": []
    400 			},
    401 			"options": {
    402 				"reduceOptions": { "calcs": ["lastNotNull"] },
    403 				"orientation": "auto",
    404 				"textMode": "auto",
    405 				"colorMode": "value",
    406 				"graphMode": "none"
    407 			}
    408 		},
    409 		{
    410 			"id": 30,
    411 			"type": "row",
    412 			"title": "Runtime",
    413 			"gridPos": { "x": 0, "y": 45, "w": 24, "h": 1 },
    414 			"collapsed": false
    415 		},
    416 		{
    417 			"id": 31,
    418 			"type": "timeseries",
    419 			"title": "Event Loop Lag",
    420 			"gridPos": { "x": 0, "y": 46, "w": 8, "h": 8 },
    421 			"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
    422 			"targets": [
    423 				{
    424 					"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
    425 					"expr": "nodejs_eventloop_lag_p50_seconds{job=\"corpus\"}",
    426 					"legendFormat": "p50",
    427 					"refId": "A"
    428 				},
    429 				{
    430 					"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
    431 					"expr": "nodejs_eventloop_lag_p90_seconds{job=\"corpus\"}",
    432 					"legendFormat": "p90",
    433 					"refId": "B"
    434 				},
    435 				{
    436 					"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
    437 					"expr": "nodejs_eventloop_lag_p99_seconds{job=\"corpus\"}",
    438 					"legendFormat": "p99",
    439 					"refId": "C"
    440 				}
    441 			],
    442 			"fieldConfig": {
    443 				"defaults": {
    444 					"unit": "s",
    445 					"custom": { "lineWidth": 1, "fillOpacity": 10 }
    446 				},
    447 				"overrides": []
    448 			},
    449 			"options": {
    450 				"tooltip": { "mode": "multi", "sort": "none" },
    451 				"legend": { "displayMode": "list", "placement": "bottom" }
    452 			}
    453 		},
    454 		{
    455 			"id": 32,
    456 			"type": "timeseries",
    457 			"title": "Memory",
    458 			"gridPos": { "x": 8, "y": 46, "w": 8, "h": 8 },
    459 			"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
    460 			"targets": [
    461 				{
    462 					"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
    463 					"expr": "process_resident_memory_bytes{job=\"corpus\"}",
    464 					"legendFormat": "RSS",
    465 					"refId": "A"
    466 				},
    467 				{
    468 					"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
    469 					"expr": "nodejs_heap_size_used_bytes{job=\"corpus\"}",
    470 					"legendFormat": "Heap Used",
    471 					"refId": "B"
    472 				},
    473 				{
    474 					"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
    475 					"expr": "nodejs_heap_size_total_bytes{job=\"corpus\"}",
    476 					"legendFormat": "Heap Total",
    477 					"refId": "C"
    478 				}
    479 			],
    480 			"fieldConfig": {
    481 				"defaults": {
    482 					"unit": "bytes",
    483 					"custom": { "lineWidth": 1, "fillOpacity": 10 }
    484 				},
    485 				"overrides": []
    486 			},
    487 			"options": {
    488 				"tooltip": { "mode": "multi", "sort": "none" },
    489 				"legend": { "displayMode": "list", "placement": "bottom" }
    490 			}
    491 		},
    492 		{
    493 			"id": 33,
    494 			"type": "timeseries",
    495 			"title": "GC Duration Rate",
    496 			"gridPos": { "x": 16, "y": 46, "w": 8, "h": 8 },
    497 			"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
    498 			"targets": [
    499 				{
    500 					"datasource": { "type": "prometheus", "uid": "DS_PROMETHEUS" },
    501 					"expr": "rate(nodejs_gc_duration_seconds_sum{job=\"corpus\"}[5m])",
    502 					"legendFormat": "{{kind}}",
    503 					"refId": "A"
    504 				}
    505 			],
    506 			"fieldConfig": {
    507 				"defaults": {
    508 					"unit": "s",
    509 					"custom": { "lineWidth": 1, "fillOpacity": 10 }
    510 				},
    511 				"overrides": []
    512 			},
    513 			"options": {
    514 				"tooltip": { "mode": "multi", "sort": "none" },
    515 				"legend": { "displayMode": "list", "placement": "bottom" }
    516 			}
    517 		}
    518 	]
    519 }