Compare commits

...

3 Commits

Author SHA1 Message Date
oysteikt 775d4da8b3 ildkule/grafana: add dashboard for php-fpm
Eval nix flake / evals (push) Successful in 6m56s
2026-07-25 22:25:05 +09:00
oysteikt 7c8d5bae3a ildkule/prometheus/phpfpm: scrape from bekkalokk
Eval nix flake / evals (push) Successful in 6m55s
2026-07-25 22:19:38 +09:00
oysteikt aef9ee0289 bekkalokk/prometheus-phpfpm-exporter: init 2026-07-25 22:19:38 +09:00
6 changed files with 1765 additions and 0 deletions
+1
View File
@@ -13,6 +13,7 @@
./services/mediawiki
./services/nginx.nix
./services/phpfpm.nix
./services/prometheus-phpfpm-exporter.nix
./services/vaultwarden.nix
./services/webmail
./services/website
@@ -0,0 +1,49 @@
{ config, lib, values, ... }:
let
cfg = config.services.prometheus.exporters.php-fpm;
pools = [
"idp"
"mediawiki"
"pvv-nettsiden"
"roundcube"
"snappymail"
];
in
{
services.phpfpm.pools = lib.genAttrs pools (_: {
settings."pm.status_path" = "/status";
});
services.prometheus.exporters.php-fpm = {
enable = true;
listenAddress = "127.0.0.1";
extraFlags = map
(name: "--phpfpm.scrape-uri=unix://${config.services.phpfpm.pools.${name}.socket};/status")
pools;
};
systemd.services.prometheus-php-fpm-exporter.serviceConfig = {
Slice = "system-monitoring.slice";
SupplementaryGroups = [ config.services.nginx.group ];
};
services.nginx = lib.mkIf cfg.enable {
virtualHosts."www.pvv.ntnu.no" = lib.mkIf config.services.nginx.enable {
forceSSL = true;
enableACME = true;
kTLS = true;
locations."/prometheus-php-fpm-exporter/metrics" = {
proxyPass = "http://localhost:${toString cfg.port}/metrics";
extraConfig = ''
allow 127.0.0.1;
allow ::1;
allow ${values.hosts.ildkule.ipv4};
allow ${values.hosts.ildkule.ipv6};
deny all;
'';
};
};
};
}
File diff suppressed because it is too large Load Diff
@@ -68,6 +68,12 @@ in {
url = "https://grafana.com/api/dashboards/9628/revisions/8/download";
options.path = dashboards/postgres.json;
}
{
name = "PHP-FPM";
type = "file";
url = "https://grafana.com/api/dashboards/25149/revisions/1/download";
options.path = dashboards/php-fpm.json;
}
{
name = "Gitea Dashboard";
type = "file";
@@ -7,6 +7,7 @@ in {
./machines.nix
./matrix-synapse.nix
./mysqld.nix
./phpfpm.nix
./postgres.nix
];
@@ -0,0 +1,15 @@
{ ... }:
{
services.prometheus.scrapeConfigs = [{
job_name = "phpfpm";
scheme = "https";
metrics_path = "/prometheus-php-fpm-exporter/metrics";
static_configs = [
{
labels.hostname = "bekkalokk";
targets = [ "www.pvv.ntnu.no:443" ];
}
];
}];
}