blob: 72bf907e9dcf5a56f0a1b6221b056e60d541459f [file] [log] [blame]
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +00001---
2groups:
3 - name: "loki_rules"
4 rules:
5 - expr: histogram_quantile(0.99, sum(rate(loki_request_duration_seconds_bucket[1m]))
6 by (le, job))
7 record: job:loki_request_duration_seconds:99quantile
8 labels:
9 cluster: "{{ include "loki.fullname" $ }}"
10 - expr: histogram_quantile(0.50, sum(rate(loki_request_duration_seconds_bucket[1m]))
11 by (le, job))
12 record: job:loki_request_duration_seconds:50quantile
13 labels:
14 cluster: "{{ include "loki.fullname" $ }}"
15 - expr: sum(rate(loki_request_duration_seconds_sum[1m])) by (job) / sum(rate(loki_request_duration_seconds_count[1m]))
16 by (job)
17 record: job:loki_request_duration_seconds:avg
18 labels:
19 cluster: "{{ include "loki.fullname" $ }}"
20 - expr: sum(rate(loki_request_duration_seconds_bucket[1m])) by (le, job)
21 record: job:loki_request_duration_seconds_bucket:sum_rate
22 labels:
23 cluster: "{{ include "loki.fullname" $ }}"
24 - expr: sum(rate(loki_request_duration_seconds_sum[1m])) by (job)
25 record: job:loki_request_duration_seconds_sum:sum_rate
26 labels:
27 cluster: "{{ include "loki.fullname" $ }}"
28 - expr: sum(rate(loki_request_duration_seconds_count[1m])) by (job)
29 record: job:loki_request_duration_seconds_count:sum_rate
30 labels:
31 cluster: "{{ include "loki.fullname" $ }}"
32 - expr: histogram_quantile(0.99, sum(rate(loki_request_duration_seconds_bucket[1m]))
33 by (le, job, route))
34 record: job_route:loki_request_duration_seconds:99quantile
35 labels:
36 cluster: "{{ include "loki.fullname" $ }}"
37 - expr: histogram_quantile(0.50, sum(rate(loki_request_duration_seconds_bucket[1m]))
38 by (le, job, route))
39 record: job_route:loki_request_duration_seconds:50quantile
40 labels:
41 cluster: "{{ include "loki.fullname" $ }}"
42 - expr: sum(rate(loki_request_duration_seconds_sum[1m])) by (job, route) / sum(rate(loki_request_duration_seconds_count[1m]))
43 by (job, route)
44 record: job_route:loki_request_duration_seconds:avg
45 labels:
46 cluster: "{{ include "loki.fullname" $ }}"
47 - expr: sum(rate(loki_request_duration_seconds_bucket[1m])) by (le, job, route)
48 record: job_route:loki_request_duration_seconds_bucket:sum_rate
49 labels:
50 cluster: "{{ include "loki.fullname" $ }}"
51 - expr: sum(rate(loki_request_duration_seconds_sum[1m])) by (job, route)
52 record: job_route:loki_request_duration_seconds_sum:sum_rate
53 labels:
54 cluster: "{{ include "loki.fullname" $ }}"
55 - expr: sum(rate(loki_request_duration_seconds_count[1m])) by (job, route)
56 record: job_route:loki_request_duration_seconds_count:sum_rate
57 labels:
58 cluster: "{{ include "loki.fullname" $ }}"
59 - expr: histogram_quantile(0.99, sum(rate(loki_request_duration_seconds_bucket[1m]))
60 by (le, namespace, job, route))
61 record: namespace_job_route:loki_request_duration_seconds:99quantile
62 labels:
63 cluster: "{{ include "loki.fullname" $ }}"
64 - expr: histogram_quantile(0.50, sum(rate(loki_request_duration_seconds_bucket[1m]))
65 by (le, namespace, job, route))
66 record: namespace_job_route:loki_request_duration_seconds:50quantile
67 labels:
68 cluster: "{{ include "loki.fullname" $ }}"
69 - expr: sum(rate(loki_request_duration_seconds_sum[1m])) by (namespace, job, route)
70 / sum(rate(loki_request_duration_seconds_count[1m])) by (namespace, job, route)
71 record: namespace_job_route:loki_request_duration_seconds:avg
72 labels:
73 cluster: "{{ include "loki.fullname" $ }}"
74 - expr: sum(rate(loki_request_duration_seconds_bucket[1m])) by (le, namespace, job,
75 route)
76 record: namespace_job_route:loki_request_duration_seconds_bucket:sum_rate
77 labels:
78 cluster: "{{ include "loki.fullname" $ }}"
79 - expr: sum(rate(loki_request_duration_seconds_sum[1m])) by (namespace, job, route)
80 record: namespace_job_route:loki_request_duration_seconds_sum:sum_rate
81 labels:
82 cluster: "{{ include "loki.fullname" $ }}"
83 - expr: sum(rate(loki_request_duration_seconds_count[1m])) by (namespace, job, route)
84 record: namespace_job_route:loki_request_duration_seconds_count:sum_rate
85 labels:
86 cluster: "{{ include "loki.fullname" $ }}"