3861: Add "meilisearch" prefix to last metrics that were missing it r=Kerollmops a=dureuill

# Pull Request

## Related issue
Related to #3790 

## What does this PR do?
- change implementation to follow the spec on metrics name
- regenerate grafana dashboard from the code

## PR checklist
Please check if your PR fulfills the following requirements:
- [ ] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
- [ ] Have you read the contributing guidelines?
- [ ] Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!


Co-authored-by: Louis Dureuil <louis@meilisearch.com>
This commit is contained in:
meili-bors[bot] 2023-06-28 09:28:31 +00:00 committed by GitHub
commit 9deeec88e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 36 deletions

View File

@ -98,7 +98,7 @@
"showThresholdMarkers": true, "showThresholdMarkers": true,
"text": {} "text": {}
}, },
"pluginVersion": "9.5.2", "pluginVersion": "10.0.1",
"targets": [ "targets": [
{ {
"datasource": { "datasource": {
@ -158,7 +158,7 @@
"showThresholdMarkers": true, "showThresholdMarkers": true,
"text": {} "text": {}
}, },
"pluginVersion": "9.5.2", "pluginVersion": "10.0.1",
"targets": [ "targets": [
{ {
"datasource": { "datasource": {
@ -176,8 +176,7 @@
}, },
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus"
"uid": "c4085c47-f6d3-45dd-b761-6809055bb749"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -221,7 +220,7 @@
"showThresholdMarkers": true, "showThresholdMarkers": true,
"text": {} "text": {}
}, },
"pluginVersion": "9.5.2", "pluginVersion": "10.0.1",
"targets": [ "targets": [
{ {
"datasource": { "datasource": {
@ -241,8 +240,7 @@
}, },
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus"
"uid": "c4085c47-f6d3-45dd-b761-6809055bb749"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -282,7 +280,7 @@
"showThresholdMarkers": true, "showThresholdMarkers": true,
"text": {} "text": {}
}, },
"pluginVersion": "9.5.2", "pluginVersion": "10.0.1",
"targets": [ "targets": [
{ {
"datasource": { "datasource": {
@ -302,8 +300,7 @@
}, },
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus"
"uid": "c4085c47-f6d3-45dd-b761-6809055bb749"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -343,7 +340,7 @@
"showThresholdMarkers": true, "showThresholdMarkers": true,
"text": {} "text": {}
}, },
"pluginVersion": "9.5.2", "pluginVersion": "10.0.1",
"targets": [ "targets": [
{ {
"datasource": { "datasource": {
@ -363,8 +360,7 @@
}, },
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus"
"uid": "c4085c47-f6d3-45dd-b761-6809055bb749"
}, },
"description": "", "description": "",
"fieldConfig": { "fieldConfig": {
@ -411,8 +407,7 @@
"mode": "absolute", "mode": "absolute",
"steps": [ "steps": [
{ {
"color": "green", "color": "green"
"value": null
}, },
{ {
"color": "red", "color": "red",
@ -460,8 +455,7 @@
}, },
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus"
"uid": "c4085c47-f6d3-45dd-b761-6809055bb749"
}, },
"editorMode": "builder", "editorMode": "builder",
"expr": "meilisearch_used_db_size_bytes{job=\"meilisearch\", instance=\"$instance\"}", "expr": "meilisearch_used_db_size_bytes{job=\"meilisearch\", instance=\"$instance\"}",
@ -559,7 +553,7 @@
}, },
"editorMode": "builder", "editorMode": "builder",
"exemplar": true, "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": "", "interval": "",
"legendFormat": "{{method}} {{path}}", "legendFormat": "{{method}} {{path}}",
"range": true, "range": true,
@ -571,8 +565,7 @@
}, },
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus"
"uid": "c4085c47-f6d3-45dd-b761-6809055bb749"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -615,8 +608,7 @@
"mode": "absolute", "mode": "absolute",
"steps": [ "steps": [
{ {
"color": "green", "color": "green"
"value": null
}, },
{ {
"color": "red", "color": "red",
@ -743,7 +735,7 @@
"unit": "s" "unit": "s"
} }
}, },
"pluginVersion": "9.5.2", "pluginVersion": "10.0.1",
"reverseYBuckets": false, "reverseYBuckets": false,
"targets": [ "targets": [
{ {
@ -752,7 +744,7 @@
}, },
"editorMode": "builder", "editorMode": "builder",
"exemplar": true, "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", "format": "heatmap",
"interval": "", "interval": "",
"legendFormat": "{{le}}", "legendFormat": "{{le}}",
@ -1306,8 +1298,7 @@
"value": "localhost:7700" "value": "localhost:7700"
}, },
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus"
"uid": "bb3298a4-9acf-4da1-b86a-813f29f50888"
}, },
"definition": "label_values(instance)", "definition": "label_values(instance)",
"hide": 0, "hide": 0,
@ -1329,12 +1320,11 @@
{ {
"current": { "current": {
"selected": false, "selected": false,
"text": "mieli", "text": "index-word-count-10-count",
"value": "mieli" "value": "index-word-count-10-count"
}, },
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus"
"uid": "bb3298a4-9acf-4da1-b86a-813f29f50888"
}, },
"definition": "label_values(index)", "definition": "label_values(index)",
"hide": 0, "hide": 0,
@ -1371,6 +1361,6 @@
"timezone": "", "timezone": "",
"title": "Meilisearch", "title": "Meilisearch",
"uid": "7wcZ94dnz", "uid": "7wcZ94dnz",
"version": 6, "version": 5,
"weekStart": "" "weekStart": ""
} }

View File

@ -16,7 +16,7 @@ fn create_buckets() -> [f64; 29] {
} }
lazy_static! { 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!( pub static ref MEILISEARCH_HTTP_REQUESTS_TOTAL: IntCounterVec = register_int_counter_vec!(
opts!("meilisearch_http_requests_total", "Meilisearch HTTP requests total"), opts!("meilisearch_http_requests_total", "Meilisearch HTTP requests total"),
&["method", "path"] &["method", "path"]
@ -39,10 +39,10 @@ lazy_static! {
) )
.expect("Can't create a metric"); .expect("Can't create a metric");
pub static ref MEILISEARCH_HTTP_RESPONSE_TIME_SECONDS: HistogramVec = register_histogram_vec!( pub static ref MEILISEARCH_HTTP_RESPONSE_TIME_SECONDS: HistogramVec = register_histogram_vec!(
"http_response_time_seconds", "meilisearch_http_response_time_seconds",
"HTTP response times", "Meilisearch HTTP response times",
&["method", "path"], &["method", "path"],
HTTP_RESPONSE_TIME_CUSTOM_BUCKETS.to_vec() MEILISEARCH_HTTP_RESPONSE_TIME_CUSTOM_BUCKETS.to_vec()
) )
.expect("Can't create a metric"); .expect("Can't create a metric");
pub static ref MEILISEARCH_NB_TASKS: IntGaugeVec = register_int_gauge_vec!( pub static ref MEILISEARCH_NB_TASKS: IntGaugeVec = register_int_gauge_vec!(