From ea68ccd03416edebaac05a13a12d2b4126da63f3 Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Wed, 28 Jun 2023 11:21:50 +0200 Subject: [PATCH 1/2] prefix http_* metrics by meilisearch --- meilisearch/src/metrics.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meilisearch/src/metrics.rs b/meilisearch/src/metrics.rs index 79332f360..b3cbb4576 100644 --- a/meilisearch/src/metrics.rs +++ b/meilisearch/src/metrics.rs @@ -16,7 +16,7 @@ fn create_buckets() -> [f64; 29] { } lazy_static! { - pub static ref HTTP_RESPONSE_TIME_CUSTOM_BUCKETS: [f64; 29] = create_buckets(); + 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"] @@ -39,10 +39,10 @@ lazy_static! { ) .expect("Can't create a metric"); pub static ref MEILISEARCH_HTTP_RESPONSE_TIME_SECONDS: HistogramVec = register_histogram_vec!( - "http_response_time_seconds", - "HTTP response times", + "meilisearch_http_response_time_seconds", + "Meilisearch HTTP response times", &["method", "path"], - HTTP_RESPONSE_TIME_CUSTOM_BUCKETS.to_vec() + MEILISEARCH_HTTP_RESPONSE_TIME_CUSTOM_BUCKETS.to_vec() ) .expect("Can't create a metric"); pub static ref MEILISEARCH_NB_TASKS: IntGaugeVec = register_int_gauge_vec!( From 167ac55a2dcdd903da7aa43dc91cb371cd2db1ee Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Wed, 28 Jun 2023 11:22:16 +0200 Subject: [PATCH 2/2] Update dashboard generated from grafana --- assets/grafana-dashboard.json | 54 ++++++++++++++--------------------- 1 file changed, 22 insertions(+), 32 deletions(-) diff --git a/assets/grafana-dashboard.json b/assets/grafana-dashboard.json index d00069293..98695a1d2 100644 --- a/assets/grafana-dashboard.json +++ b/assets/grafana-dashboard.json @@ -98,7 +98,7 @@ "showThresholdMarkers": true, "text": {} }, - "pluginVersion": "9.5.2", + "pluginVersion": "10.0.1", "targets": [ { "datasource": { @@ -158,7 +158,7 @@ "showThresholdMarkers": true, "text": {} }, - "pluginVersion": "9.5.2", + "pluginVersion": "10.0.1", "targets": [ { "datasource": { @@ -176,8 +176,7 @@ }, { "datasource": { - "type": "prometheus", - "uid": "c4085c47-f6d3-45dd-b761-6809055bb749" + "type": "prometheus" }, "fieldConfig": { "defaults": { @@ -221,7 +220,7 @@ "showThresholdMarkers": true, "text": {} }, - "pluginVersion": "9.5.2", + "pluginVersion": "10.0.1", "targets": [ { "datasource": { @@ -241,8 +240,7 @@ }, { "datasource": { - "type": "prometheus", - "uid": "c4085c47-f6d3-45dd-b761-6809055bb749" + "type": "prometheus" }, "fieldConfig": { "defaults": { @@ -282,7 +280,7 @@ "showThresholdMarkers": true, "text": {} }, - "pluginVersion": "9.5.2", + "pluginVersion": "10.0.1", "targets": [ { "datasource": { @@ -302,8 +300,7 @@ }, { "datasource": { - "type": "prometheus", - "uid": "c4085c47-f6d3-45dd-b761-6809055bb749" + "type": "prometheus" }, "fieldConfig": { "defaults": { @@ -343,7 +340,7 @@ "showThresholdMarkers": true, "text": {} }, - "pluginVersion": "9.5.2", + "pluginVersion": "10.0.1", "targets": [ { "datasource": { @@ -363,8 +360,7 @@ }, { "datasource": { - "type": "prometheus", - "uid": "c4085c47-f6d3-45dd-b761-6809055bb749" + "type": "prometheus" }, "description": "", "fieldConfig": { @@ -411,8 +407,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -460,8 +455,7 @@ }, { "datasource": { - "type": "prometheus", - "uid": "c4085c47-f6d3-45dd-b761-6809055bb749" + "type": "prometheus" }, "editorMode": "builder", "expr": "meilisearch_used_db_size_bytes{job=\"meilisearch\", instance=\"$instance\"}", @@ -559,7 +553,7 @@ }, "editorMode": "builder", "exemplar": true, - "expr": "rate(http_response_time_seconds_sum{instance=\"$instance\", job=\"meilisearch\"}[5m]) / rate(http_response_time_seconds_count[5m])", + "expr": "rate(meilisearch_http_response_time_seconds_sum{instance=\"$instance\", job=\"meilisearch\"}[5m]) / rate(meilisearch_http_response_time_seconds_count[5m])", "interval": "", "legendFormat": "{{method}} {{path}}", "range": true, @@ -571,8 +565,7 @@ }, { "datasource": { - "type": "prometheus", - "uid": "c4085c47-f6d3-45dd-b761-6809055bb749" + "type": "prometheus" }, "fieldConfig": { "defaults": { @@ -615,8 +608,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -743,7 +735,7 @@ "unit": "s" } }, - "pluginVersion": "9.5.2", + "pluginVersion": "10.0.1", "reverseYBuckets": false, "targets": [ { @@ -752,7 +744,7 @@ }, "editorMode": "builder", "exemplar": true, - "expr": "sum by(le) (increase(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=\"meilisearch\"}[30s]))", "format": "heatmap", "interval": "", "legendFormat": "{{le}}", @@ -1306,8 +1298,7 @@ "value": "localhost:7700" }, "datasource": { - "type": "prometheus", - "uid": "bb3298a4-9acf-4da1-b86a-813f29f50888" + "type": "prometheus" }, "definition": "label_values(instance)", "hide": 0, @@ -1329,12 +1320,11 @@ { "current": { "selected": false, - "text": "mieli", - "value": "mieli" + "text": "index-word-count-10-count", + "value": "index-word-count-10-count" }, "datasource": { - "type": "prometheus", - "uid": "bb3298a4-9acf-4da1-b86a-813f29f50888" + "type": "prometheus" }, "definition": "label_values(index)", "hide": 0, @@ -1371,6 +1361,6 @@ "timezone": "", "title": "Meilisearch", "uid": "7wcZ94dnz", - "version": 6, + "version": 5, "weekStart": "" -} \ No newline at end of file +}