format tree
This commit is contained in:
parent
24547fcd6c
commit
92c55595d0
43 changed files with 476 additions and 357 deletions
modules/nixos/monitoring
|
@ -2,15 +2,17 @@
|
|||
{
|
||||
srvos.prometheus = {
|
||||
ruleGroups.srvosAlerts.alertRules =
|
||||
(lib.genAttrs [
|
||||
"borgbackup-job-github-org.service"
|
||||
"borgbackup-job-nixpkgs-update.service"
|
||||
]
|
||||
(lib.genAttrs
|
||||
[
|
||||
"borgbackup-job-github-org.service"
|
||||
"borgbackup-job-nixpkgs-update.service"
|
||||
]
|
||||
(name: {
|
||||
expr = ''absent_over_time(task_last_run{name="${name}"}[1d])'';
|
||||
annotations.description = "status of ${name} is unknown: no data for a day";
|
||||
})) //
|
||||
{
|
||||
})
|
||||
)
|
||||
// {
|
||||
CominDeploymentDifferentCommits = {
|
||||
expr = ''count(count by (commit_id) (comin_deployment_info)) > 1'';
|
||||
for = "90m";
|
||||
|
|
|
@ -27,9 +27,7 @@ in
|
|||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart = "${matrixHook}/bin/matrix-hook";
|
||||
EnvironmentFile = [
|
||||
config.sops.secrets.nix-community-matrix-bot-token.path
|
||||
];
|
||||
EnvironmentFile = [ config.sops.secrets.nix-community-matrix-bot-token.path ];
|
||||
Restart = "always";
|
||||
RestartSec = "10";
|
||||
User = "matrix-hook";
|
||||
|
|
|
@ -8,7 +8,10 @@
|
|||
enable = true;
|
||||
checkConfig = true;
|
||||
webExternalUrl = "https://monitoring.nix-community.org/prometheus/";
|
||||
extraFlags = [ "--storage.tsdb.retention.time=30d" "--web.route-prefix=/" ];
|
||||
extraFlags = [
|
||||
"--storage.tsdb.retention.time=30d"
|
||||
"--web.route-prefix=/"
|
||||
];
|
||||
scrapeConfigs = [
|
||||
{
|
||||
job_name = "telegraf";
|
||||
|
@ -26,15 +29,7 @@
|
|||
];
|
||||
}
|
||||
];
|
||||
alertmanagers = [
|
||||
{
|
||||
static_configs = [
|
||||
{
|
||||
targets = [ "localhost:9093" ];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
alertmanagers = [ { static_configs = [ { targets = [ "localhost:9093" ]; } ]; } ];
|
||||
};
|
||||
|
||||
services.telegraf.extraConfig.inputs.prometheus.urls = [
|
||||
|
@ -46,7 +41,10 @@
|
|||
enable = true;
|
||||
webExternalUrl = "https://monitoring.nix-community.org/alertmanager/";
|
||||
listenAddress = "[::1]";
|
||||
extraFlags = [ "--cluster.listen-address=''" "--web.route-prefix=/" ];
|
||||
extraFlags = [
|
||||
"--cluster.listen-address=''"
|
||||
"--web.route-prefix=/"
|
||||
];
|
||||
configuration = {
|
||||
route = {
|
||||
receiver = "default";
|
||||
|
@ -70,9 +68,7 @@
|
|||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
name = "default";
|
||||
}
|
||||
{ name = "default"; }
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
|
@ -30,19 +30,15 @@
|
|||
let
|
||||
hosts = import ./hosts.nix;
|
||||
in
|
||||
map
|
||||
(host: {
|
||||
protocol = "tcp";
|
||||
address = "${host}:22";
|
||||
send = "SSH-2.0-Telegraf";
|
||||
expect = "SSH-2.0";
|
||||
tags.host = host;
|
||||
tags.org = "nix-community";
|
||||
timeout = "10s";
|
||||
})
|
||||
hosts;
|
||||
prometheus.urls = [
|
||||
"https://events.ofborg.org/prometheus.php"
|
||||
];
|
||||
map (host: {
|
||||
protocol = "tcp";
|
||||
address = "${host}:22";
|
||||
send = "SSH-2.0-Telegraf";
|
||||
expect = "SSH-2.0";
|
||||
tags.host = host;
|
||||
tags.org = "nix-community";
|
||||
timeout = "10s";
|
||||
}) hosts;
|
||||
prometheus.urls = [ "https://events.ofborg.org/prometheus.php" ];
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue