modules/monitoring: Extract metrics from nginx logs
This commit is contained in:
@@ -52,6 +52,12 @@ let
|
||||
attrByPath ["clerie" "monitoring" "blackbox"] false host.config)
|
||||
monitoringHosts);
|
||||
|
||||
nginxlogMonitoringTargets = mapAttrsToList (name: host:
|
||||
"${host.config.networking.hostName}.mon.clerie.de:9117")
|
||||
(filterAttrs (name: host:
|
||||
attrByPath ["services" "prometheus" "exporters" "nginxlog" "enable"] false host.config)
|
||||
monitoringHosts);
|
||||
|
||||
eachWithEachOther = (f: x: y: lib.lists.flatten (lib.lists.forEach x (a: lib.lists.forEach y (b: f a b))));
|
||||
|
||||
in {
|
||||
@@ -536,6 +542,18 @@ in {
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
job_name = "nginxlog-exporter";
|
||||
scrape_interval = "20s";
|
||||
static_configs = [
|
||||
{
|
||||
targets = nginxlogMonitoringTargets;
|
||||
}
|
||||
];
|
||||
relabel_configs = [
|
||||
relabelAddressToInstance
|
||||
];
|
||||
}
|
||||
];
|
||||
alertmanagers = [
|
||||
{
|
||||
|
Reference in New Issue
Block a user