mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
Merge pull request #98738 from mayflower/prometheus-retention
nixos/prometheus: add retentionTime
This commit is contained in:
commit
bb33cdd44b
1 changed files with 11 additions and 2 deletions
|
@ -49,8 +49,8 @@ let
|
||||||
"--web.listen-address=${cfg.listenAddress}:${builtins.toString cfg.port}"
|
"--web.listen-address=${cfg.listenAddress}:${builtins.toString cfg.port}"
|
||||||
"--alertmanager.notification-queue-capacity=${toString cfg.alertmanagerNotificationQueueCapacity}"
|
"--alertmanager.notification-queue-capacity=${toString cfg.alertmanagerNotificationQueueCapacity}"
|
||||||
"--alertmanager.timeout=${toString cfg.alertmanagerTimeout}s"
|
"--alertmanager.timeout=${toString cfg.alertmanagerTimeout}s"
|
||||||
] ++
|
] ++ optional (cfg.webExternalUrl != null) "--web.external-url=${cfg.webExternalUrl}"
|
||||||
optional (cfg.webExternalUrl != null) "--web.external-url=${cfg.webExternalUrl}";
|
++ optional (cfg.retentionTime != null) "--storage.tsdb.retention.time=${cfg.retentionTime}";
|
||||||
|
|
||||||
filterValidPrometheus = filterAttrsListRecursive (n: v: !(n == "_module" || v == null));
|
filterValidPrometheus = filterAttrsListRecursive (n: v: !(n == "_module" || v == null));
|
||||||
filterAttrsListRecursive = pred: x:
|
filterAttrsListRecursive = pred: x:
|
||||||
|
@ -624,6 +624,15 @@ in {
|
||||||
errors, despite a correct configuration.
|
errors, despite a correct configuration.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
retentionTime = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = null;
|
||||||
|
example = "15d";
|
||||||
|
description = ''
|
||||||
|
How long to retain samples in storage.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue