mirror of
https://github.com/kittywitch/nixfiles.git
synced 2026-02-09 04:19:19 -08:00
further refactor work
This commit is contained in:
parent
eb4713ec37
commit
befe6ea564
32 changed files with 39 additions and 14 deletions
115
nixos/servers/grafana-stack/prometheus.nix
Normal file
115
nixos/servers/grafana-stack/prometheus.nix
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
{config, ...}: {
|
||||
services.prometheus = {
|
||||
enable = true;
|
||||
port = 9001;
|
||||
exporters = {
|
||||
node = {
|
||||
enable = true;
|
||||
enabledCollectors = ["systemd"];
|
||||
port = 9002;
|
||||
};
|
||||
postgres = {
|
||||
enable = true;
|
||||
port = 9187;
|
||||
runAsLocalSuperUser = true;
|
||||
extraFlags = ["--auto-discover-databases"];
|
||||
};
|
||||
domain = {
|
||||
enable = true;
|
||||
};
|
||||
nginx = {
|
||||
enable = true;
|
||||
sslVerify = false;
|
||||
};
|
||||
};
|
||||
ruleFiles = [
|
||||
./synapse-v2.rules
|
||||
];
|
||||
scrapeConfigs = [
|
||||
{
|
||||
job_name = "tewi-hass";
|
||||
scrape_interval = "60s";
|
||||
metrics_path = "/api/prometheus";
|
||||
scheme = "https";
|
||||
bearer_token = "!!HOME_ASSISTANT_API_TOKEN!!";
|
||||
static_configs = [
|
||||
{
|
||||
targets = ["home.gensokyo.zone:443"];
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
job_name = "${config.networking.hostName}-minecraft";
|
||||
static_configs = [
|
||||
{
|
||||
targets = ["127.0.0.1:25585"];
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
job_name = "${config.networking.hostName}";
|
||||
static_configs = [
|
||||
{
|
||||
targets = ["127.0.0.1:${toString config.services.prometheus.exporters.node.port}"];
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
job_name = "${config.networking.hostName}-telegraf";
|
||||
static_configs = [
|
||||
{
|
||||
targets = ["127.0.0.1:9125"];
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
job_name = "${config.networking.hostName}-postgres";
|
||||
static_configs = [
|
||||
{
|
||||
targets = ["127.0.0.1:${toString config.services.prometheus.exporters.postgres.port}"];
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
job_name = "${config.networking.hostName}-nginx";
|
||||
static_configs = [
|
||||
{
|
||||
targets = ["127.0.0.1:${toString config.services.prometheus.exporters.nginx.port}"];
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
job_name = "domains";
|
||||
metrics_path = "/probe";
|
||||
relabel_configs = [
|
||||
{
|
||||
source_labels = ["__address__"];
|
||||
target_label = "__param_target";
|
||||
}
|
||||
{
|
||||
target_label = "__address__";
|
||||
replacement = "127.0.0.1:${toString config.services.prometheus.exporters.domain.port}";
|
||||
}
|
||||
];
|
||||
static_configs = [
|
||||
{
|
||||
targets = [
|
||||
"dork.dev"
|
||||
"inskip.me"
|
||||
"gensokyo.zone"
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
job_name = "${config.networking.hostName}-synapse";
|
||||
metrics_path = "/_synapse/metrics";
|
||||
static_configs = [
|
||||
{
|
||||
targets = ["[::1]:8009"];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue