apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
  name: meilisearch
  namespace: jellyfin
  labels:
    app.kubernetes.io/name: meilisearch
    app.kubernetes.io/instance: jellyfin
    app.kubernetes.io/part-of: jellyfin
spec:
  groups:
    - name: EmbeddedExporter
      rules:
        - alert: MeilisearchIndexIsEmpty
          expr: meilisearch_index_docs_count == 0
          for: 0m
          labels:
            severity: warning
          annotations:
            summary: Meilisearch index is empty (instance {{ $labels.instance }})
            description: "Meilisearch index {{ $labels.index }} has zero documents\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
        - alert: MeilisearchHttpResponseTime
          expr: meilisearch_http_response_time_seconds > 0.5
          for: 0m
          labels:
            severity: warning
          annotations:
            summary: Meilisearch http response time (instance {{ $labels.instance }})
            description: "Meilisearch http response time is too high\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
