From bee4c5166410122fe7c7728ff22d7afbab71987c Mon Sep 17 00:00:00 2001 From: Alessandro Gregori Date: Fri, 28 Jun 2024 10:31:35 +0200 Subject: [PATCH 1/4] feat(meilisearch): add basic meilisearch rules --- _data/rules.yml | 13 +++++++++++ dist/rules/meilisearch/embedded-exporter.yml | 23 ++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 dist/rules/meilisearch/embedded-exporter.yml diff --git a/_data/rules.yml b/_data/rules.yml index 8994d4470..81581909f 100644 --- a/_data/rules.yml +++ b/_data/rules.yml @@ -842,6 +842,19 @@ groups: query: "increase(redis_rejected_connections_total[1m]) > 0" severity: critical + - name: Meilisearch + exporters: + - doc_url: https://github.com/orgs/meilisearch/discussions/625 + rules: + - name: Meilisearch index is empty + description: Meilisearch instance is down + query: 'meilisearch_index_docs_count{index="$Index"} = 0' + severity: warning + - name: Meilisearch http response time + description: Meilisearch http response time is too high + query: "meilisearch_http_response_time_seconds > 0.5" + severity: warning + - name: MongoDB exporters: - name: percona/mongodb_exporter diff --git a/dist/rules/meilisearch/embedded-exporter.yml b/dist/rules/meilisearch/embedded-exporter.yml new file mode 100644 index 000000000..86c460f58 --- /dev/null +++ b/dist/rules/meilisearch/embedded-exporter.yml @@ -0,0 +1,23 @@ +groups: + +- name: EmbeddedExporter + + rules: + + - alert: MeilisearchIndexIsEmpty + expr: meilisearch_index_docs_count{index="$Index"} = 0 + for: 5m + labels: + severity: warning + annotations: + summary: the index {{ $labels.Index }} is empty + description: "The index {{ $labels.Index }} is empty at the moment, and shouldnt be empty\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" + + - alert: MeilisearchHttpResponseTimeIsTooHigh + expr: rate(meilisearch_http_response_time_seconds_sum[5m]) / rate(meilisearch_http_response_time_seconds_count[5m]) > 0.5 + for: 5m + labels: + severity: warning + annotations: + summary: the meilisearch server http response time is too high + description: "The meilisearch server http response time is too high at the moment\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" \ No newline at end of file From eda71b626b30eaf8c6b5aeb0d73d8f030ce7c782 Mon Sep 17 00:00:00 2001 From: Alessandro Gregori Date: Mon, 1 Jul 2024 15:18:21 +0200 Subject: [PATCH 2/4] fix(query): use == instead of = --- dist/rules/meilisearch/embedded-exporter.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/rules/meilisearch/embedded-exporter.yml b/dist/rules/meilisearch/embedded-exporter.yml index 86c460f58..a16a336b0 100644 --- a/dist/rules/meilisearch/embedded-exporter.yml +++ b/dist/rules/meilisearch/embedded-exporter.yml @@ -5,7 +5,7 @@ groups: rules: - alert: MeilisearchIndexIsEmpty - expr: meilisearch_index_docs_count{index="$Index"} = 0 + expr: meilisearch_index_docs_count{index="$Index"} == 0 for: 5m labels: severity: warning @@ -20,4 +20,4 @@ groups: severity: warning annotations: summary: the meilisearch server http response time is too high - description: "The meilisearch server http response time is too high at the moment\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" \ No newline at end of file + description: "The meilisearch server http response time is too high at the moment\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" From 100da75bbd407303ef347e427967e1007c1f7a0a Mon Sep 17 00:00:00 2001 From: Alessandro Gregori Date: Mon, 1 Jul 2024 15:18:33 +0200 Subject: [PATCH 3/4] fix(data): set correct name and use == --- _data/rules.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/_data/rules.yml b/_data/rules.yml index 81581909f..e7d7551dd 100644 --- a/_data/rules.yml +++ b/_data/rules.yml @@ -844,11 +844,13 @@ groups: - name: Meilisearch exporters: - - doc_url: https://github.com/orgs/meilisearch/discussions/625 + - name: Embedded exporter + slug: embedded-exporter + doc_url: https://github.com/orgs/meilisearch/discussions/625 rules: - name: Meilisearch index is empty description: Meilisearch instance is down - query: 'meilisearch_index_docs_count{index="$Index"} = 0' + query: 'meilisearch_index_docs_count{index="$Index"} == 0' severity: warning - name: Meilisearch http response time description: Meilisearch http response time is too high From 176038ec26b30377be2a2216095281bf22f42445 Mon Sep 17 00:00:00 2001 From: Alessandro Gregori Date: Tue, 2 Jul 2024 09:27:52 +0200 Subject: [PATCH 4/4] chore(meilisearch): remove index filter --- _data/rules.yml | 2 +- dist/rules/meilisearch/embedded-exporter.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/_data/rules.yml b/_data/rules.yml index e7d7551dd..128793fc3 100644 --- a/_data/rules.yml +++ b/_data/rules.yml @@ -850,7 +850,7 @@ groups: rules: - name: Meilisearch index is empty description: Meilisearch instance is down - query: 'meilisearch_index_docs_count{index="$Index"} == 0' + query: 'meilisearch_index_docs_count == 0' severity: warning - name: Meilisearch http response time description: Meilisearch http response time is too high diff --git a/dist/rules/meilisearch/embedded-exporter.yml b/dist/rules/meilisearch/embedded-exporter.yml index a16a336b0..a8824dd3a 100644 --- a/dist/rules/meilisearch/embedded-exporter.yml +++ b/dist/rules/meilisearch/embedded-exporter.yml @@ -5,7 +5,7 @@ groups: rules: - alert: MeilisearchIndexIsEmpty - expr: meilisearch_index_docs_count{index="$Index"} == 0 + expr: meilisearch_index_docs_count == 0 for: 5m labels: severity: warning