ildkule: add config for prometheus_mysqld_exporter
There's a PR waiting to add this module to nixpkgs, so we should enable this once it gets merged.
This commit is contained in:
25
hosts/ildkule/services/metrics/prometheus/mysqld.nix
Normal file
25
hosts/ildkule/services/metrics/prometheus/mysqld.nix
Normal file
@@ -0,0 +1,25 @@
|
||||
{ config, unstable, ... }: 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;
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user