diff --git a/assets/grafana-dashboard.json b/assets/grafana-dashboard.json index 74a456b97..2cfa85a46 100644 --- a/assets/grafana-dashboard.json +++ b/assets/grafana-dashboard.json @@ -1,4 +1,47 @@ { + "__inputs": [ + { + "name": "DS_PROMETHEUS", + "label": "prometheus", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "panel", + "id": "gauge", + "name": "Gauge", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "10.4.1" + }, + { + "type": "panel", + "id": "heatmap", + "name": "Heatmap", + "version": "" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + } + ], "annotations": { "list": [ { @@ -24,7 +67,7 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 2, + "id": null, "links": [], "liveNow": false, "panels": [ @@ -54,7 +97,8 @@ }, { "datasource": { - "type": "prometheus" + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, "fieldConfig": { "defaults": { @@ -86,6 +130,8 @@ "id": 22, "interval": "5s", "options": { + "minVizHeight": 75, + "minVizWidth": 75, "orientation": "auto", "reduceOptions": { "calcs": [ @@ -96,13 +142,15 @@ }, "showThresholdLabels": false, "showThresholdMarkers": true, + "sizing": "auto", "text": {} }, - "pluginVersion": "10.0.1", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { - "type": "prometheus" + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, "editorMode": "builder", "exemplar": true, @@ -118,7 +166,8 @@ }, { "datasource": { - "type": "prometheus" + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, "fieldConfig": { "defaults": { @@ -146,6 +195,8 @@ }, "id": 18, "options": { + "minVizHeight": 75, + "minVizWidth": 75, "orientation": "auto", "reduceOptions": { "calcs": [ @@ -156,13 +207,15 @@ }, "showThresholdLabels": false, "showThresholdMarkers": true, + "sizing": "auto", "text": {} }, - "pluginVersion": "10.0.1", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { - "type": "prometheus" + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, "editorMode": "builder", "expr": "meilisearch_index_docs_count{job=\"$job\", index=\"$Index\", instance=\"$instance\"}", @@ -176,71 +229,8 @@ }, { "datasource": { - "type": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 6, - "w": 4, - "x": 12, - "y": 1 - }, - "id": 19, - "options": { - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "text": {} - }, - "pluginVersion": "10.0.1", - "targets": [ - { - "datasource": { - "type": "prometheus" - }, - "editorMode": "builder", - "exemplar": true, - "expr": "round(increase(meilisearch_http_requests_total{method=\"POST\", path=\"/indexes/$Index/search\", job=\"$job\"}[1h]))", - "interval": "", - "legendFormat": "", - "range": true, - "refId": "A" - } - ], - "title": "Total Searches (1h)", - "type": "gauge" - }, - { - "datasource": { - "type": "prometheus" + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, "fieldConfig": { "defaults": { @@ -272,6 +262,8 @@ }, "id": 26, "options": { + "minVizHeight": 75, + "minVizWidth": 75, "orientation": "auto", "reduceOptions": { "calcs": [ @@ -282,13 +274,15 @@ }, "showThresholdLabels": false, "showThresholdMarkers": true, + "sizing": "auto", "text": {} }, - "pluginVersion": "9.5.2", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { - "type": "prometheus" + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, "editorMode": "builder", "exemplar": true, @@ -304,7 +298,77 @@ }, { "datasource": { - "type": "prometheus" + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 4, + "x": 12, + "y": 1 + }, + "id": 19, + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto", + "text": {} + }, + "pluginVersion": "10.4.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "builder", + "exemplar": true, + "expr": "round(increase(meilisearch_http_requests_total{method=\"POST\", path=\"/indexes/$Index/search\", job=\"$job\"}[1h]))", + "interval": "", + "legendFormat": "", + "range": true, + "refId": "A" + } + ], + "title": "Total Searches (1h)", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, "fieldConfig": { "defaults": { @@ -332,6 +396,8 @@ }, "id": 20, "options": { + "minVizHeight": 75, + "minVizWidth": 75, "orientation": "auto", "reduceOptions": { "calcs": [ @@ -342,13 +408,15 @@ }, "showThresholdLabels": false, "showThresholdMarkers": true, + "sizing": "auto", "text": {} }, - "pluginVersion": "10.0.1", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { - "type": "prometheus" + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, "editorMode": "builder", "exemplar": true, @@ -364,7 +432,8 @@ }, { "datasource": { - "type": "prometheus" + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, "fieldConfig": { "defaults": { @@ -392,6 +461,8 @@ }, "id": 21, "options": { + "minVizHeight": 75, + "minVizWidth": 75, "orientation": "auto", "reduceOptions": { "calcs": [ @@ -402,13 +473,15 @@ }, "showThresholdLabels": false, "showThresholdMarkers": true, + "sizing": "auto", "text": {} }, - "pluginVersion": "10.0.1", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { - "type": "prometheus" + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, "editorMode": "builder", "exemplar": true, @@ -424,7 +497,8 @@ }, { "datasource": { - "type": "prometheus" + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, "description": "", "fieldConfig": { @@ -433,6 +507,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -446,6 +521,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineStyle": { "fill": "solid" @@ -471,7 +547,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -507,7 +584,8 @@ "targets": [ { "datasource": { - "type": "prometheus" + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, "editorMode": "builder", "exemplar": true, @@ -519,7 +597,8 @@ }, { "datasource": { - "type": "prometheus" + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, "editorMode": "builder", "expr": "meilisearch_used_db_size_bytes{job=\"$job\", instance=\"$instance\"}", @@ -534,7 +613,8 @@ }, { "datasource": { - "type": "prometheus" + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, "fieldConfig": { "defaults": { @@ -542,6 +622,7 @@ "mode": "continuous-YlBl" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -555,6 +636,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -613,7 +695,8 @@ "targets": [ { "datasource": { - "type": "prometheus" + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, "editorMode": "builder", "exemplar": true, @@ -629,7 +712,192 @@ }, { "datasource": { - "type": "prometheus" + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "number of requests per second, faceted by its HTTP status code", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 12, + "x": 0, + "y": 18 + }, + "id": 27, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "sum(rate(meilisearch_http_requests_total{instance=~\"$instance\",job=~\"$job\"} [$__rate_interval])) by (status)", + "instant": false, + "legendFormat": "HTTP Server - {{status}}", + "range": true, + "refId": "A" + } + ], + "title": "Request Rate", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "percentage of 4xx and 5xx HTTP responses over the total of the requests", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 12, + "x": 12, + "y": 18 + }, + "id": 28, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "sum by (status) (rate(meilisearch_http_requests_total{status=~\"(4|5).*\",instance=~\"$instance\",job=~\"$job\"}[$__rate_interval])) / ignoring(status) group_left sum(rate(meilisearch_http_requests_total{instance=~\"$instance\",job=~\"$job\"}[$__rate_interval]))", + "instant": false, + "legendFormat": "HTTP Server - {{status}}", + "range": true, + "refId": "A" + } + ], + "title": "Error Rate", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, "fieldConfig": { "defaults": { @@ -637,6 +905,7 @@ "mode": "continuous-YlBl" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -650,6 +919,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -687,7 +957,7 @@ "h": 11, "w": 12, "x": 0, - "y": 18 + "y": 29 }, "id": 1, "interval": "5s", @@ -706,7 +976,8 @@ "targets": [ { "datasource": { - "type": "prometheus" + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, "editorMode": "builder", "exemplar": true, @@ -731,7 +1002,8 @@ }, "dataFormat": "tsbuckets", "datasource": { - "type": "prometheus" + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, "fieldConfig": { "defaults": { @@ -752,7 +1024,7 @@ "h": 11, "w": 12, "x": 12, - "y": 18 + "y": 29 }, "heatmap": {}, "hideZeroBuckets": false, @@ -789,7 +1061,8 @@ }, "showValue": "never", "tooltip": { - "show": true, + "mode": "single", + "showColorScale": false, "yHistogram": false }, "yAxis": { @@ -799,12 +1072,13 @@ "unit": "s" } }, - "pluginVersion": "10.0.1", + "pluginVersion": "10.4.1", "reverseYBuckets": false, "targets": [ { "datasource": { - "type": "prometheus" + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, "editorMode": "builder", "exemplar": true, @@ -836,13 +1110,17 @@ "yBucketNumber": 10 }, { - "datasource": {}, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -856,6 +1134,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -877,8 +1156,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -894,7 +1172,7 @@ "h": 11, "w": 12, "x": 0, - "y": 29 + "y": 40 }, "id": 23, "interval": "5s", @@ -914,7 +1192,8 @@ "targets": [ { "datasource": { - "type": "prometheus" + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, "editorMode": "builder", "exemplar": true, @@ -929,13 +1208,17 @@ "type": "timeseries" }, { - "datasource": {}, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -949,6 +1232,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -970,8 +1254,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -987,7 +1270,7 @@ "h": 11, "w": 12, "x": 12, - "y": 29 + "y": 40 }, "id": 24, "interval": "5s", @@ -1007,7 +1290,8 @@ "targets": [ { "datasource": { - "type": "prometheus" + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, "editorMode": "builder", "exemplar": true, @@ -1022,13 +1306,17 @@ "type": "timeseries" }, { - "datasource": {}, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -1042,6 +1330,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -1063,8 +1352,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1080,7 +1368,7 @@ "h": 11, "w": 12, "x": 0, - "y": 40 + "y": 51 }, "id": 25, "interval": "5s", @@ -1100,7 +1388,8 @@ "targets": [ { "datasource": { - "type": "prometheus" + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, "editorMode": "builder", "exemplar": true, @@ -1115,7 +1404,7 @@ "type": "timeseries" }, { - "collapsed": false, + "collapsed": true, "datasource": { "type": "prometheus", "uid": "i51CxikVz" @@ -1124,10 +1413,227 @@ "h": 1, "w": 24, "x": 0, - "y": 51 + "y": 62 }, "id": 12, - "panels": [], + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-YlBl" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 15, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 12, + "x": 0, + "y": 60 + }, + "id": 4, + "interval": "5s", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "builder", + "exemplar": true, + "expr": "rate(process_cpu_seconds_total{job=\"$job\", instance=\"$instance\"}[1m])", + "interval": "", + "legendFormat": "process", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "exemplar": true, + "expr": "sum(rate(container_cpu_usage_seconds_total{name='mongodb-redis'}[1m])) by (name)", + "interval": "", + "legendFormat": "container", + "refId": "B" + } + ], + "title": "CPU usage", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-YlBl" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "MiB", + "axisPlacement": "left", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 15, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 12, + "x": 12, + "y": 60 + }, + "id": 5, + "interval": "5s", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "builder", + "exemplar": true, + "expr": "process_resident_memory_bytes{job=\"$job\", instance=\"$instance\"} / 1024 / 1024", + "interval": "", + "legendFormat": "process", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "exemplar": true, + "expr": "container_memory_usage_bytes{name=\"mongodb-redis\"} / 1024 / 1024", + "interval": "", + "legendFormat": "container", + "refId": "B" + } + ], + "title": "Memory usage", + "type": "timeseries" + } + ], "targets": [ { "datasource": { @@ -1139,230 +1645,18 @@ ], "title": "System metrics", "type": "row" - }, - { - "datasource": { - "type": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "continuous-YlBl" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 15, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "decimals": 2, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 11, - "w": 12, - "x": 0, - "y": 52 - }, - "id": 4, - "interval": "5s", - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus" - }, - "editorMode": "builder", - "exemplar": true, - "expr": "rate(process_cpu_seconds_total{job=\"$job\", instance=\"$instance\"}[1m])", - "interval": "", - "legendFormat": "process", - "range": true, - "refId": "A" - }, - { - "datasource": { - "type": "prometheus" - }, - "exemplar": true, - "expr": "sum(rate(container_cpu_usage_seconds_total{name='mongodb-redis'}[1m])) by (name)", - "interval": "", - "legendFormat": "container", - "refId": "B" - } - ], - "title": "CPU usage", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "continuous-YlBl" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "MiB", - "axisPlacement": "left", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 15, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 11, - "w": 12, - "x": 12, - "y": 52 - }, - "id": 5, - "interval": "5s", - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus" - }, - "editorMode": "builder", - "exemplar": true, - "expr": "process_resident_memory_bytes{job=\"$job\", instance=\"$instance\"} / 1024 / 1024", - "interval": "", - "legendFormat": "process", - "range": true, - "refId": "A" - }, - { - "datasource": { - "type": "prometheus" - }, - "exemplar": true, - "expr": "container_memory_usage_bytes{name=\"mongodb-redis\"} / 1024 / 1024", - "interval": "", - "legendFormat": "container", - "refId": "B" - } - ], - "title": "Memory usage", - "type": "timeseries" } ], - "refresh": "5s", - "schemaVersion": 38, - "style": "dark", + "refresh": "10s", + "schemaVersion": 39, "tags": [], "templating": { "list": [ { - "current": { - "selected": false, - "text": "localhost:7700", - "value": "localhost:7700" - }, + "current": {}, "datasource": { - "type": "prometheus" + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, "definition": "label_values(instance)", "hide": 0, @@ -1382,13 +1676,10 @@ "type": "query" }, { - "current": { - "selected": false, - "text": "index-word-count-10-count", - "value": "index-word-count-10-count" - }, + "current": {}, "datasource": { - "type": "prometheus" + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, "definition": "label_values(index)", "hide": 0, @@ -1408,13 +1699,10 @@ "type": "query" }, { - "current": { - "selected": true, - "text": "meilisearch", - "value": "meilisearch" - }, + "current": {}, "datasource": { - "type": "prometheus" + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, "definition": "label_values(job)", "description": "Prometheus job_name from scrape config (default is meilisearch)", @@ -1452,6 +1740,6 @@ "timezone": "", "title": "Meilisearch", "uid": "7wcZ94dnz", - "version": 5, + "version": 2, "weekStart": "" -} +} \ No newline at end of file diff --git a/meilisearch/src/metrics.rs b/meilisearch/src/metrics.rs index 652e6c227..3be12c7ce 100644 --- a/meilisearch/src/metrics.rs +++ b/meilisearch/src/metrics.rs @@ -19,7 +19,7 @@ lazy_static! { pub static ref MEILISEARCH_HTTP_RESPONSE_TIME_CUSTOM_BUCKETS: [f64; 29] = create_buckets(); pub static ref MEILISEARCH_HTTP_REQUESTS_TOTAL: IntCounterVec = register_int_counter_vec!( opts!("meilisearch_http_requests_total", "Meilisearch HTTP requests total"), - &["method", "path"] + &["method", "path", "status"] ) .expect("Can't create a metric"); pub static ref MEILISEARCH_DEGRADED_SEARCH_REQUESTS: IntGauge = register_int_gauge!(opts!( diff --git a/meilisearch/src/middleware.rs b/meilisearch/src/middleware.rs index 5b87dee34..6707bb6d5 100644 --- a/meilisearch/src/middleware.rs +++ b/meilisearch/src/middleware.rs @@ -65,9 +65,6 @@ where .with_label_values(&[&request_method, request_path]) .start_timer(), ); - crate::metrics::MEILISEARCH_HTTP_REQUESTS_TOTAL - .with_label_values(&[&request_method, request_path]) - .inc(); } }; @@ -76,6 +73,14 @@ where Box::pin(async move { let res = fut.await?; + crate::metrics::MEILISEARCH_HTTP_REQUESTS_TOTAL + .with_label_values(&[ + res.request().method().as_str(), + res.request().path(), + res.status().as_str(), + ]) + .inc(); + if let Some(histogram_timer) = histogram_timer { histogram_timer.observe_duration(); };