mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 14:54:29 +01:00
prometheus-node-exporter service: update for new arguments handling
The behaviour have changed again. Listed collectors are now enabled in addition to the default one. Also run as DynmicUser instead of user nobody as the exporter doesn't need any state.
This commit is contained in:
parent
38a66bb033
commit
0f0f0cbc6f
1 changed files with 4 additions and 5 deletions
|
@ -33,7 +33,7 @@ in {
|
|||
default = [];
|
||||
example = ''[ "systemd" ]'';
|
||||
description = ''
|
||||
Collectors to enable. Only collectors explicitly listed here will be enabled.
|
||||
Collectors to enable. The collectors listed here are enabled in addition to the default ones.
|
||||
'';
|
||||
};
|
||||
|
||||
|
@ -64,13 +64,12 @@ in {
|
|||
wantedBy = [ "multi-user.target" ];
|
||||
script = ''
|
||||
exec ${pkgs.prometheus-node-exporter}/bin/node_exporter \
|
||||
${optionalString (cfg.enabledCollectors != [])
|
||||
''-collectors.enabled ${concatStringsSep "," cfg.enabledCollectors}''} \
|
||||
-web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
|
||||
${concatMapStrings (x: "--collector." + x + " ") cfg.enabledCollectors} \
|
||||
--web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
|
||||
${concatStringsSep " \\\n " cfg.extraFlags}
|
||||
'';
|
||||
serviceConfig = {
|
||||
User = "nobody";
|
||||
DynamicUser = true;
|
||||
Restart = "always";
|
||||
PrivateTmp = true;
|
||||
WorkingDirectory = /tmp;
|
||||
|
|
Loading…
Reference in a new issue