mirror of
https://git.sr.ht/~rouven/nixos-config
synced 2025-04-28 09:28:30 +02:00
more monitoring
This commit is contained in:
parent
5089f62112
commit
53eb192ea8
9 changed files with 147 additions and 24 deletions
|
@ -85,6 +85,9 @@ in
|
|||
services.prometheus = {
|
||||
enable = true;
|
||||
port = 9001;
|
||||
ruleFiles = [
|
||||
./synapse-v2.rules
|
||||
];
|
||||
exporters = {
|
||||
node = {
|
||||
enable = true;
|
||||
|
@ -107,9 +110,9 @@ in
|
|||
{
|
||||
job_name = "synapse";
|
||||
static_configs = [{
|
||||
targets = [ "matrix.rfive.de:8008" ];
|
||||
targets = [ "nuc.vpn.rfive.de:8008" ];
|
||||
}];
|
||||
metrics_path = "/synapse/metrics";
|
||||
metrics_path = "/_synapse/metrics";
|
||||
scrape_interval = "15s";
|
||||
}
|
||||
{
|
||||
|
@ -118,6 +121,12 @@ in
|
|||
targets = [ "falkenstein.vpn.rfive.de:11334" ];
|
||||
}];
|
||||
}
|
||||
{
|
||||
job_name = "authentik";
|
||||
static_configs = [{
|
||||
targets = [ "nuc.vpn.rfive.de:9300" ];
|
||||
}];
|
||||
}
|
||||
{
|
||||
job_name = "caddy";
|
||||
static_configs = [{
|
||||
|
@ -269,6 +278,7 @@ in
|
|||
# host = "matrix.rfive.de";
|
||||
agent = "caddy-promtail";
|
||||
__path__ = "/var/log/caddy/*.log";
|
||||
host = "nuc";
|
||||
};
|
||||
}
|
||||
];
|
||||
|
@ -290,6 +300,19 @@ in
|
|||
db_type = "city";
|
||||
};
|
||||
}
|
||||
{
|
||||
geoip = {
|
||||
db = "/var/lib/GeoIP/GeoLite2-ASN.mmdb";
|
||||
source = "remote_ip";
|
||||
db_type = "asn";
|
||||
};
|
||||
}
|
||||
{
|
||||
labeldrop = [
|
||||
"geoip_subdivision_code"
|
||||
"geoip_continent_code"
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
}
|
||||
|
|
74
hosts/nuc/modules/monitoring/synapse-v2.rules
Normal file
74
hosts/nuc/modules/monitoring/synapse-v2.rules
Normal file
|
@ -0,0 +1,74 @@
|
|||
groups:
|
||||
- name: synapse
|
||||
rules:
|
||||
|
||||
###
|
||||
### Prometheus Console Only
|
||||
### The following rules are only needed if you use the Prometheus Console
|
||||
### in contrib/prometheus/consoles/synapse.html
|
||||
###
|
||||
- record: 'synapse_federation_client_sent'
|
||||
labels:
|
||||
type: "EDU"
|
||||
expr: 'synapse_federation_client_sent_edus_total + 0'
|
||||
- record: 'synapse_federation_client_sent'
|
||||
labels:
|
||||
type: "PDU"
|
||||
expr: 'synapse_federation_client_sent_pdu_destinations_count_total + 0'
|
||||
- record: 'synapse_federation_client_sent'
|
||||
labels:
|
||||
type: "Query"
|
||||
expr: 'sum(synapse_federation_client_sent_queries) by (job)'
|
||||
|
||||
- record: 'synapse_federation_server_received'
|
||||
labels:
|
||||
type: "EDU"
|
||||
expr: 'synapse_federation_server_received_edus_total + 0'
|
||||
- record: 'synapse_federation_server_received'
|
||||
labels:
|
||||
type: "PDU"
|
||||
expr: 'synapse_federation_server_received_pdus_total + 0'
|
||||
- record: 'synapse_federation_server_received'
|
||||
labels:
|
||||
type: "Query"
|
||||
expr: 'sum(synapse_federation_server_received_queries) by (job)'
|
||||
|
||||
- record: 'synapse_federation_transaction_queue_pending'
|
||||
labels:
|
||||
type: "EDU"
|
||||
expr: 'synapse_federation_transaction_queue_pending_edus + 0'
|
||||
- record: 'synapse_federation_transaction_queue_pending'
|
||||
labels:
|
||||
type: "PDU"
|
||||
expr: 'synapse_federation_transaction_queue_pending_pdus + 0'
|
||||
###
|
||||
### End of 'Prometheus Console Only' rules block
|
||||
###
|
||||
|
||||
|
||||
###
|
||||
### Grafana Only
|
||||
### The following rules are only needed if you use the Grafana dashboard
|
||||
### in contrib/grafana/synapse.json
|
||||
###
|
||||
- record: synapse_storage_events_persisted_by_source_type
|
||||
expr: sum without(type, origin_type, origin_entity) (synapse_storage_events_persisted_events_sep_total{origin_type="remote"})
|
||||
labels:
|
||||
type: remote
|
||||
- record: synapse_storage_events_persisted_by_source_type
|
||||
expr: sum without(type, origin_type, origin_entity) (synapse_storage_events_persisted_events_sep_total{origin_entity="*client*",origin_type="local"})
|
||||
labels:
|
||||
type: local
|
||||
- record: synapse_storage_events_persisted_by_source_type
|
||||
expr: sum without(type, origin_type, origin_entity) (synapse_storage_events_persisted_events_sep_total{origin_entity!="*client*",origin_type="local"})
|
||||
labels:
|
||||
type: bridges
|
||||
|
||||
- record: synapse_storage_events_persisted_by_event_type
|
||||
expr: sum without(origin_entity, origin_type) (synapse_storage_events_persisted_events_sep_total)
|
||||
|
||||
- record: synapse_storage_events_persisted_by_origin
|
||||
expr: sum without(type) (synapse_storage_events_persisted_events_sep_total)
|
||||
###
|
||||
### End of 'Grafana Only' rules block
|
||||
###
|
Loading…
Add table
Add a link
Reference in a new issue