Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit ac7e568

Browse files
authored
Add comments to the Prometheus recording rules to make it clear which set of rules you need for Grafana or Prometheus Console. (#13876)
1 parent c9316f9 commit ac7e568

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

changelog.d/13876.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add comments to the Prometheus recording rules to make it clear which set of rules you need for Grafana or Prometheus Console.

contrib/prometheus/synapse-v2.rules

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
groups:
22
- name: synapse
33
rules:
4-
# These 3 rules are used in the included Prometheus console
4+
5+
###
6+
### Prometheus Console Only
7+
### The following rules are only needed if you use the Prometheus Console
8+
### in contrib/prometheus/consoles/synapse.html
9+
###
510
- record: 'synapse_federation_client_sent'
611
labels:
712
type: "EDU"
@@ -15,7 +20,6 @@ groups:
1520
type: "Query"
1621
expr: 'sum(synapse_federation_client_sent_queries) by (job)'
1722

18-
# These 3 rules are used in the included Prometheus console
1923
- record: 'synapse_federation_server_received'
2024
labels:
2125
type: "EDU"
@@ -29,7 +33,6 @@ groups:
2933
type: "Query"
3034
expr: 'sum(synapse_federation_server_received_queries) by (job)'
3135

32-
# These 2 rules are used in the included Prometheus console
3336
- record: 'synapse_federation_transaction_queue_pending'
3437
labels:
3538
type: "EDU"
@@ -38,8 +41,16 @@ groups:
3841
labels:
3942
type: "PDU"
4043
expr: 'synapse_federation_transaction_queue_pending_pdus + 0'
44+
###
45+
### End of 'Prometheus Console Only' rules block
46+
###
47+
4148

42-
# These 3 rules are used in the included Grafana dashboard
49+
###
50+
### Grafana Only
51+
### The following rules are only needed if you use the Grafana dashboard
52+
### in contrib/grafana/synapse.json
53+
###
4354
- record: synapse_storage_events_persisted_by_source_type
4455
expr: sum without(type, origin_type, origin_entity) (synapse_storage_events_persisted_events_sep_total{origin_type="remote"})
4556
labels:
@@ -53,11 +64,11 @@ groups:
5364
labels:
5465
type: bridges
5566

56-
# This rule is used in the included Grafana dashboard
5767
- record: synapse_storage_events_persisted_by_event_type
5868
expr: sum without(origin_entity, origin_type) (synapse_storage_events_persisted_events_sep_total)
5969

60-
# This rule is used in the included Grafana dashboard
6170
- record: synapse_storage_events_persisted_by_origin
6271
expr: sum without(type) (synapse_storage_events_persisted_events_sep_total)
63-
72+
###
73+
### End of 'Grafana Only' rules block
74+
###

0 commit comments

Comments
 (0)