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:
2023-07-10 00:00:13 +02:00
parent 998e66db65
commit 34a16149f8
5 changed files with 3842 additions and 5 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -64,6 +64,13 @@ in {
url = "https://raw.githubusercontent.com/matrix-org/synapse/develop/contrib/grafana/synapse.json";
options.path = dashboards/synapse.json;
}
# TODO: enable once https://github.com/NixOS/nixpkgs/pull/242365 gets merged
# {
# name = "MySQL";
# type = "file";
# url = "https://raw.githubusercontent.com/prometheus/mysqld_exporter/main/mysqld-mixin/dashboards/mysql-overview.json";
# options.path = dashboards/mysql.json;
# }
{
name = "Postgresql";
type = "file";

View File

@@ -1,9 +1,11 @@
{ config, ... }: {
imports = [
./node.nix
./matrix-synapse.nix
./postgres.nix
./gogs.nix
./matrix-synapse.nix
# TODO: enable once https://github.com/NixOS/nixpkgs/pull/242365 gets merged
# ./mysqld.nix
./node.nix
./postgres.nix
];
services.prometheus = {

View 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;
};
};
}