feat: add job variable to dashboard

meilisearch job_name was hardcoded in the dashboard config

so if user sets anything but meilisearch as job_name on

prometheus side the dashboard does not work

see: https://github.com/orgs/meilisearch/discussions/625#discussioncomment-8143282
This commit is contained in:
capJavert 2024-01-16 12:44:37 +01:00
parent 8e016fbfeb
commit 5dc8d9e9bf
No known key found for this signature in database
GPG Key ID: CE21FF7C634E76D7

View File

@ -106,7 +106,7 @@
}, },
"editorMode": "builder", "editorMode": "builder",
"exemplar": true, "exemplar": true,
"expr": "meilisearch_index_count{job=\"meilisearch\", instance=\"$instance\"}", "expr": "meilisearch_index_count{job=\"$job\", instance=\"$instance\"}",
"interval": "", "interval": "",
"legendFormat": "", "legendFormat": "",
"range": true, "range": true,
@ -165,7 +165,7 @@
"type": "prometheus" "type": "prometheus"
}, },
"editorMode": "builder", "editorMode": "builder",
"expr": "meilisearch_index_docs_count{job=\"meilisearch\", index=\"$Index\", instance=\"$instance\"}", "expr": "meilisearch_index_docs_count{job=\"$job\", index=\"$Index\", instance=\"$instance\"}",
"hide": false, "hide": false,
"range": true, "range": true,
"refId": "A" "refId": "A"
@ -228,7 +228,7 @@
}, },
"editorMode": "builder", "editorMode": "builder",
"exemplar": true, "exemplar": true,
"expr": "round(increase(meilisearch_http_requests_total{method=\"POST\", path=\"/indexes/$Index/search\", job=\"meilisearch\"}[1h]))", "expr": "round(increase(meilisearch_http_requests_total{method=\"POST\", path=\"/indexes/$Index/search\", job=\"$job\"}[1h]))",
"interval": "", "interval": "",
"legendFormat": "", "legendFormat": "",
"range": true, "range": true,
@ -288,7 +288,7 @@
}, },
"editorMode": "builder", "editorMode": "builder",
"exemplar": true, "exemplar": true,
"expr": "round(increase(meilisearch_http_requests_total{method=\"POST\", path=\"/indexes/$Index/search\", job=\"meilisearch\"}[24h]))", "expr": "round(increase(meilisearch_http_requests_total{method=\"POST\", path=\"/indexes/$Index/search\", job=\"$job\"}[24h]))",
"interval": "", "interval": "",
"legendFormat": "", "legendFormat": "",
"range": true, "range": true,
@ -348,7 +348,7 @@
}, },
"editorMode": "builder", "editorMode": "builder",
"exemplar": true, "exemplar": true,
"expr": "round(increase(meilisearch_http_requests_total{method=\"POST\", path=\"/indexes/$Index/search\", job=\"meilisearch\"}[30d]))", "expr": "round(increase(meilisearch_http_requests_total{method=\"POST\", path=\"/indexes/$Index/search\", job=\"$job\"}[30d]))",
"interval": "", "interval": "",
"legendFormat": "", "legendFormat": "",
"range": true, "range": true,
@ -447,7 +447,7 @@
}, },
"editorMode": "builder", "editorMode": "builder",
"exemplar": true, "exemplar": true,
"expr": "meilisearch_db_size_bytes{job=\"meilisearch\", instance=\"$instance\"}", "expr": "meilisearch_db_size_bytes{job=\"$job\", instance=\"$instance\"}",
"interval": "", "interval": "",
"legendFormat": "Database size on disk", "legendFormat": "Database size on disk",
"range": true, "range": true,
@ -458,7 +458,7 @@
"type": "prometheus" "type": "prometheus"
}, },
"editorMode": "builder", "editorMode": "builder",
"expr": "meilisearch_used_db_size_bytes{job=\"meilisearch\", instance=\"$instance\"}", "expr": "meilisearch_used_db_size_bytes{job=\"$job\", instance=\"$instance\"}",
"hide": false, "hide": false,
"legendFormat": "Used bytes", "legendFormat": "Used bytes",
"range": true, "range": true,
@ -553,7 +553,7 @@
}, },
"editorMode": "builder", "editorMode": "builder",
"exemplar": true, "exemplar": true,
"expr": "rate(meilisearch_http_response_time_seconds_sum{instance=\"$instance\", job=\"meilisearch\"}[5m]) / rate(meilisearch_http_response_time_seconds_count[5m])", "expr": "rate(meilisearch_http_response_time_seconds_sum{instance=\"$instance\", job=\"$job\"}[5m]) / rate(meilisearch_http_response_time_seconds_count[5m])",
"interval": "", "interval": "",
"legendFormat": "{{method}} {{path}}", "legendFormat": "{{method}} {{path}}",
"range": true, "range": true,
@ -646,7 +646,7 @@
}, },
"editorMode": "builder", "editorMode": "builder",
"exemplar": true, "exemplar": true,
"expr": "rate(meilisearch_http_requests_total{instance=\"$instance\", job=\"meilisearch\"}[5m])", "expr": "rate(meilisearch_http_requests_total{instance=\"$instance\", job=\"$job\"}[5m])",
"interval": "", "interval": "",
"legendFormat": "{{method}} {{path}}", "legendFormat": "{{method}} {{path}}",
"range": true, "range": true,
@ -744,7 +744,7 @@
}, },
"editorMode": "builder", "editorMode": "builder",
"exemplar": true, "exemplar": true,
"expr": "sum by(le) (increase(meilisearch_http_response_time_seconds_bucket{path=\"/indexes/$Index/search\", instance=\"$instance\", job=\"meilisearch\"}[30s]))", "expr": "sum by(le) (increase(meilisearch_http_response_time_seconds_bucket{path=\"/indexes/$Index/search\", instance=\"$instance\", job=\"$job\"}[30s]))",
"format": "heatmap", "format": "heatmap",
"interval": "", "interval": "",
"legendFormat": "{{le}}", "legendFormat": "{{le}}",
@ -854,7 +854,7 @@
}, },
"editorMode": "builder", "editorMode": "builder",
"exemplar": true, "exemplar": true,
"expr": "meilisearch_nb_tasks{instance=\"$instance\", job=\"meilisearch\", kind=\"statuses\"}", "expr": "meilisearch_nb_tasks{instance=\"$instance\", job=\"$job\", kind=\"statuses\"}",
"interval": "", "interval": "",
"legendFormat": "{{value}} ", "legendFormat": "{{value}} ",
"range": true, "range": true,
@ -947,7 +947,7 @@
}, },
"editorMode": "builder", "editorMode": "builder",
"exemplar": true, "exemplar": true,
"expr": "meilisearch_nb_tasks{instance=\"$instance\", job=\"meilisearch\", kind=\"types\"}", "expr": "meilisearch_nb_tasks{instance=\"$instance\", job=\"$job\", kind=\"types\"}",
"interval": "", "interval": "",
"legendFormat": "{{value}} ", "legendFormat": "{{value}} ",
"range": true, "range": true,
@ -1040,7 +1040,7 @@
}, },
"editorMode": "builder", "editorMode": "builder",
"exemplar": true, "exemplar": true,
"expr": "meilisearch_nb_tasks{instance=\"$instance\", job=\"meilisearch\", kind=\"indexes\"}", "expr": "meilisearch_nb_tasks{instance=\"$instance\", job=\"$job\", kind=\"indexes\"}",
"interval": "", "interval": "",
"legendFormat": "{{value}} ", "legendFormat": "{{value}} ",
"range": true, "range": true,
@ -1161,7 +1161,7 @@
}, },
"editorMode": "builder", "editorMode": "builder",
"exemplar": true, "exemplar": true,
"expr": "rate(process_cpu_seconds_total{job=\"meilisearch\", instance=\"$instance\"}[1m])", "expr": "rate(process_cpu_seconds_total{job=\"$job\", instance=\"$instance\"}[1m])",
"interval": "", "interval": "",
"legendFormat": "process", "legendFormat": "process",
"range": true, "range": true,
@ -1264,7 +1264,7 @@
}, },
"editorMode": "builder", "editorMode": "builder",
"exemplar": true, "exemplar": true,
"expr": "process_resident_memory_bytes{job=\"meilisearch\", instance=\"$instance\"} / 1024 / 1024", "expr": "process_resident_memory_bytes{job=\"$job\", instance=\"$instance\"} / 1024 / 1024",
"interval": "", "interval": "",
"legendFormat": "process", "legendFormat": "process",
"range": true, "range": true,
@ -1342,6 +1342,33 @@
"skipUrlSync": false, "skipUrlSync": false,
"sort": 0, "sort": 0,
"type": "query" "type": "query"
},
{
"current": {
"selected": true,
"text": "meilisearch",
"value": "meilisearch"
},
"datasource": {
"type": "prometheus"
},
"definition": "label_values(job)",
"description": "Prometheus job_name from scrape config (default is meilisearch)",
"hide": 0,
"includeAll": false,
"label": "Job",
"multi": false,
"name": "job",
"options": [],
"query": {
"query": "label_values(job)",
"refId": "StandardVariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
} }
] ]
}, },