pvv-nixos-config/hosts/ildkule/services/metrics/prometheus/mysqld.nix
h7x4 3caa66fb64
All checks were successful
Eval nix flake / evals (push) Successful in 3m3s
rename input: unstable -> nixpkgs-unstable
2023-11-05 01:22:48 +01:00

26 lines
559 B
Nix

{ config, ... }: let
cfg = config.services.prometheus;
in {
sops.secrets."config/mysqld_exporter" = { };
services.prometheus = {
scrapeConfigs = [{
job_name = "mysql";
scheme = "http";
metrics_path = cfg.exporters.mysqld.telemetryPath;
static_configs = [
{
targets = [
"localhost:${toString cfg.exporters.mysqld.port}"
];
}
];
}];
exporters.mysqld = {
enable = true;
configFilePath = config.sops.secrets."config/mysqld_exporter".path;
};
};
}