add c10y o11y

This commit is contained in:
Henry Hiles 2026-10-12 12:54:35 -04:00
commit e97861a45a
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
5 changed files with 103 additions and 60 deletions

View file

@ -14,10 +14,6 @@
enable = true;
domain = "federated.nexus";
settings = {
cache_capacity_modifier = 1.5;
db_cache_capacity_mb = 4096;
allow_sticky_events = true;
admins_list = [
"@nexusbot:federated.nexus"
"@quadradical:federated.nexus"

View file

@ -23,7 +23,10 @@ in
{
grafana = {
enable = true;
declarativePlugins = [ ];
declarativePlugins = with pkgs.grafanaPlugins; [
prometheus
];
settings = {
server = {
inherit domain;
@ -183,6 +186,14 @@ in
hash = "sha256-6bM0mqm1nF7xadc0ojNWIxJXCHio5db97NjENHIpwdI=";
};
}
{
name = "Continuwuity Stats";
options.path = pkgs.fetchurl {
name = "continuwuity-stats.json";
url = "https://continuwuity.org/guides/grafana-dashboard.json";
hash = "sha256-1s7vFEaZMiqH9h//BdrBwtWuYiqlxzUmYwdpMPYyuMo=";
};
}
{
name = "Caddy Hosts";
options.path = pkgs.stdenv.mkDerivation {

View file

@ -1,5 +1,9 @@
{ config, ... }:
{
systemd.services.prometheus.serviceConfig.SupplementaryGroups = [
config.services.matrix-continuwuity.group
];
services.prometheus = {
enable = true;
listenAddress = "127.0.0.7";
@ -32,6 +36,19 @@
{ targets = [ "localhost:2019" ]; }
];
}
{
job_name = "continuwuity";
metrics_path = "/_continuwuity/metrics";
static_configs = [
{ targets = [ "localhost" ]; }
];
relabel_configs = [
{
target_label = "__unix_socket__";
replacement = config.services.matrix-continuwuity.settings.global.unix_socket_path;
}
];
}
];
exporters = {

8
flake.lock generated
View file

@ -163,11 +163,11 @@
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1791595419,
"narHash": "sha256-RS5WNLNGkVHvGu6yHj6iPyV8kctqkddJYh/QqltcZ94=",
"lastModified": 1791801165,
"narHash": "sha256-jyUFvwEP82yuuhfZ13ei9Syq62PC9fqlKFarHpQU2X8=",
"ref": "refs/heads/main",
"rev": "3af5302dd8764d8521db2030a010a80e6ea60664",
"revCount": 7917,
"rev": "7da0ef6e2b3349b7c83b006a67b5854466dbf910",
"revCount": 7945,
"type": "git",
"url": "https://forgejo.ellis.link/continuwuation/continuwuity"
},

View file

@ -18,7 +18,12 @@
};
};
config.services =
config = {
systemd.services.caddy.serviceConfig.SupplementaryGroups = [
config.services.matrix-continuwuity.group
];
services =
let
subdomain = "matrix.${config.quad.matrix.domain}";
socket = "/var/run/continuwuity/continuwuity.sock";
@ -27,7 +32,6 @@
matrix-continuwuity = {
enable = config.quad.matrix.enable;
package = inputs.continuwuity.packages.${pkgs.stdenv.hostPlatform.system}.default;
group = "caddy";
settings.global = lib.recursiveUpdate {
server_name = config.quad.matrix.domain;
unix_socket_path = socket;
@ -50,6 +54,12 @@
url_preview_domain_explicit_allowlist = [ "*" ];
url_preview_max_spider_size = 2097152;
cache_capacity_modifier = 1.5;
db_cache_capacity_mb = 4096;
allow_sticky_events = true;
allow_prometheus_metrics = true;
max_request_size = 256000000;
dns_cache_entries = 0;
@ -68,6 +78,15 @@
} config.quad.matrix.settings;
};
caddy.virtualHosts."${subdomain}".extraConfig = "reverse_proxy unix/${socket}";
caddy.virtualHosts."${subdomain}".extraConfig = ''
handle /_continuwuity/metrics {
respond 404
}
handle {
reverse_proxy unix/${socket}
}
'';
};
};
}