File: redis.libsonnet

package info (click to toggle)
prometheus-redis-exporter 1.69.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 768 kB
  • sloc: makefile: 121; sh: 92
file content (83 lines) | stat: -rwxr-xr-x 3,182 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
{
  prometheusAlerts+:: {
    groups+: [
      {
        name: 'redis',
        rules: [
          {
            alert: 'RedisDown',
            expr: 'redis_up{%(redisExporterSelector)s} == 0' % $._config,
            'for': '5m',
            labels: {
              severity: 'critical',
            },
            annotations: {
              summary: 'Redis down (instance {{ $labels.instance }})',
              description: 'Redis instance is down\n  VALUE = {{ $value }}\n  LABELS: {{ $labels }}',
            },
          },
          {
            alert: 'RedisOutOfMemory',
            expr: 'redis_memory_used_bytes{%(redisExporterSelector)s} / redis_total_system_memory_bytes{%(redisExporterSelector)s} * 100 > 90' % $._config,
            'for': '5m',
            labels: {
              severity: 'warning',
            },
            annotations: {
              summary: 'Redis out of memory (instance {{ $labels.instance }})',
              description: 'Redis is running out of memory (> 90%)\n  VALUE = {{ $value }}\n  LABELS: {{ $labels }}',
            },
          },
          {
            alert: 'RedisTooManyConnections',
            expr: 'redis_connected_clients{%(redisExporterSelector)s} > %(redisConnectionsThreshold)s' % $._config,
            'for': '5m',
            labels: {
              severity: 'warning',
            },
            annotations: {
              summary: 'Redis too many connections (instance {{ $labels.instance }})',
              description: 'Redis instance has too many connections\n  VALUE = {{ $value }}\n  LABELS: {{ $labels }}',
            },
          },
          {
            alert: 'RedisClusterSlotFail',
            expr: 'redis_cluster_slots_fail{%(redisExporterSelector)s} > 0' % $._config,
            'for': '5m',
            labels: {
              severity: 'warning',
            },
            annotations: {
              summary: 'Number of hash slots mapping to a node in FAIL state (instance {{ $labels.instance }})',
              description: 'Redis cluster has slots fail\n  VALUE = {{ $value }}\n  LABELS: {{ $labels }}',
            },
          },
          {
            alert: 'RedisClusterSlotPfail',
            expr: 'redis_cluster_slots_pfail{%(redisExporterSelector)s} > 0' % $._config,
            'for': '5m',
            labels: {
              severity: 'warning',
            },
            annotations: {
              summary: 'Number of hash slots mapping to a node in PFAIL state (instance {{ $labels.instance }})',
              description: 'Redis cluster has slots pfail\n  VALUE = {{ $value }}\n  LABELS: {{ $labels }}',
            },
          },
          {
            alert: 'RedisClusterStateNotOk',
            expr: 'redis_cluster_state{%(redisExporterSelector)s} == 0' % $._config,
            'for': '5m',
            labels: {
              severity: 'critical',
            },
            annotations: {
              summary: 'Redis cluster state is not ok (instance {{ $labels.instance }})',
              description: 'Redis cluster is not ok\n  VALUE = {{ $value }}\n  LABELS: {{ $labels }}',
            },
          },
        ],
      },
    ],
  },
}