-
-
Notifications
You must be signed in to change notification settings - Fork 15k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/prometheus: remove services.prometheus.environmentFile #144984
nixos/prometheus: remove services.prometheus.environmentFile #144984
Conversation
The option `services.prometheus.environmentFile` has been removed since it was causing [issues](NixOS#126083) and Prometheus now has native support for secret files.
@GrahamcOfBorg test prometheus |
serviceConfig = { | ||
ExecStart = "${cfg.package}/bin/prometheus" + | ||
optionalString (length cmdlineArgs != 0) (" \\\n " + | ||
concatStringsSep " \\\n " cmdlineArgs); | ||
ExecReload = mkIf cfg.enableReload "+${reload}/bin/reload-prometheus"; | ||
User = "prometheus"; | ||
Restart = "always"; | ||
EnvironmentFile = mkIf (cfg.environmentFile != null && !cfg.enableReload) [ cfg.environmentFile ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there maybe a deprecation phase with a warning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is causing issues (#126083, #127889 (comment)) and since there's now an alternative I think it's better to go without a deprecation cycle. I did now add a mkRemovedOptionModule
so that users get a helpful error message when they define services.prometheus.environmentFile
.
@@ -76,8 +69,8 @@ let | |||
"--storage.tsdb.path=${workingDir}/data/" | |||
"--config.file=${ | |||
if cfg.enableReload | |||
then prometheusYmlOut | |||
else "/run/prometheus/prometheus-substituted.yaml" | |||
then "/etc/prometheus/prometheus.yaml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also how does the new secrets work? Can we add documentation for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the alternatives to the release notes and to the mkRemovedOptionModule
error message.
…ronmentFile is defined
@GrahamcOfBorg test prometheus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am happy with this. 👍
Motivation for this change
The option
services.prometheus.environmentFile
has been removed since it was causing issues and Prometheus now has native support for secret files.This fixes #126083 and replaces #128731.
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)