Enable metrics for matrix-synapse
This commit is contained in:
parent
71f7131b7d
commit
139033130f
4 changed files with 52 additions and 40 deletions
|
@ -9,7 +9,7 @@
|
||||||
hostName = "matrix";
|
hostName = "matrix";
|
||||||
firewall = {
|
firewall = {
|
||||||
enable = true;
|
enable = true;
|
||||||
allowedTCPPorts = [ 80 8443 8448 ];
|
allowedTCPPorts = [ 80 8443 8448 9000 ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -3,26 +3,40 @@
|
||||||
services.matrix-synapse = {
|
services.matrix-synapse = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
listeners = [{
|
listeners = [
|
||||||
port = 8008;
|
{
|
||||||
bind_addresses = [
|
port = 8008;
|
||||||
"::1"
|
bind_addresses = [
|
||||||
"127.0.0.1"
|
"::1"
|
||||||
];
|
"127.0.0.1"
|
||||||
type = "http";
|
];
|
||||||
tls = false;
|
type = "http";
|
||||||
x_forwarded = true;
|
tls = false;
|
||||||
resources = [
|
x_forwarded = true;
|
||||||
{
|
resources = [
|
||||||
compress = true;
|
{
|
||||||
names = [ "client" ];
|
compress = true;
|
||||||
}
|
names = [ "client" ];
|
||||||
{
|
}
|
||||||
|
{
|
||||||
|
compress = false;
|
||||||
|
names = [ "federation" ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
port = 9000;
|
||||||
|
type = "http";
|
||||||
|
tls = false;
|
||||||
|
bind_addresses = [
|
||||||
|
"0.0.0.0"
|
||||||
|
];
|
||||||
|
resources = [{
|
||||||
|
names = [ "metrics" ];
|
||||||
compress = false;
|
compress = false;
|
||||||
names = [ "federation" ];
|
}];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}];
|
|
||||||
server_name = "nekover.se";
|
server_name = "nekover.se";
|
||||||
public_baseurl = "https://matrix.nekover.se";
|
public_baseurl = "https://matrix.nekover.se";
|
||||||
database = {
|
database = {
|
||||||
|
@ -40,6 +54,7 @@
|
||||||
signing_key_path = "/secrets/matrix-homeserver-signing-key.secret";
|
signing_key_path = "/secrets/matrix-homeserver-signing-key.secret";
|
||||||
admin_contact = "mailto:admin@nekover.se";
|
admin_contact = "mailto:admin@nekover.se";
|
||||||
web_client_location = "https://element.nekover.se";
|
web_client_location = "https://element.nekover.se";
|
||||||
|
enable_metrics = true;
|
||||||
turn_uris = [
|
turn_uris = [
|
||||||
"turns:turn.nekover.se?transport=udp"
|
"turns:turn.nekover.se?transport=udp"
|
||||||
"turns:turn.nekover.se?transport=tcp"
|
"turns:turn.nekover.se?transport=tcp"
|
||||||
|
|
|
@ -22,25 +22,6 @@
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
"alertmanager.grzb.de"= {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
listen = [
|
|
||||||
{
|
|
||||||
addr = "0.0.0.0";
|
|
||||||
port = 80;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
addr = "0.0.0.0";
|
|
||||||
port = 443;
|
|
||||||
ssl = true;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://${config.services.prometheus.alertmanager.listenAddress}:${builtins.toString config.services.prometheus.alertmanager.port}";
|
|
||||||
proxyWebsockets = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,16 @@
|
||||||
{ hosts, ... }:
|
{ hosts, pkgs, ... }:
|
||||||
|
let
|
||||||
|
# https://github.com/element-hq/synapse/tree/master/contrib/prometheus/
|
||||||
|
synapseRules = pkgs.fetchurl {
|
||||||
|
url = "https://raw.githubusercontent.com/element-hq/synapse/refs/heads/master/contrib/prometheus/synapse-v2.rules";
|
||||||
|
hash = "sha256-WldlBdCMzul49OlFhJMsrx4MYFakHTa36Y9HnV22EwI=";
|
||||||
|
};
|
||||||
|
in
|
||||||
{
|
{
|
||||||
services.prometheus = {
|
services.prometheus = {
|
||||||
enable = true;
|
enable = true;
|
||||||
retentionTime = "90d";
|
retentionTime = "90d";
|
||||||
|
ruleFiles = [ synapseRules ];
|
||||||
scrapeConfigs = [
|
scrapeConfigs = [
|
||||||
{
|
{
|
||||||
job_name = "node";
|
job_name = "node";
|
||||||
|
@ -15,6 +23,14 @@
|
||||||
};
|
};
|
||||||
}) (builtins.attrNames hosts);
|
}) (builtins.attrNames hosts);
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
job_name = "synapse";
|
||||||
|
scrape_interval = "15s";
|
||||||
|
metrics_path = "/_synapse/metrics";
|
||||||
|
static_configs = [{
|
||||||
|
targets = [ "matrix.vs.grzb.de:9000" ];
|
||||||
|
}];
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue