mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 13:40:28 +03:00
Merge pull request #66476 from WilliButz/fix-prometheus-alertmanager-option
nixos/prometheus2: replace alertmanagerURL with new alertmanagers option
This commit is contained in:
commit
f3160a2db6
2 changed files with 21 additions and 9 deletions
|
@ -79,12 +79,8 @@ let
|
|||
(pkgs.writeText "prometheus.rules" (concatStringsSep "\n" cfg2.rules))
|
||||
]);
|
||||
scrape_configs = filterValidPrometheus cfg2.scrapeConfigs;
|
||||
alerting = optionalAttrs (cfg2.alertmanagerURL != []) {
|
||||
alertmanagers = [{
|
||||
static_configs = [{
|
||||
targets = cfg2.alertmanagerURL;
|
||||
}];
|
||||
}];
|
||||
alerting = {
|
||||
inherit (cfg2) alertmanagers;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -738,11 +734,23 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
alertmanagerURL = mkOption {
|
||||
type = types.listOf types.str;
|
||||
alertmanagers = mkOption {
|
||||
type = types.listOf types.attrs;
|
||||
example = literalExample ''
|
||||
[ {
|
||||
scheme = "https";
|
||||
path_prefix = "/alertmanager";
|
||||
static_configs = [ {
|
||||
targets = [
|
||||
"prometheus.domain.tld"
|
||||
];
|
||||
} ];
|
||||
} ]
|
||||
'';
|
||||
default = [];
|
||||
description = ''
|
||||
List of Alertmanager URLs to send notifications to.
|
||||
A list of alertmanagers to send alerts to.
|
||||
See <link xlink:href="https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alertmanager_config">the official documentation</link> for more information.
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue