Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
services/prometheus/exporters: add scaphandre
- Loading branch information
1 parent
1602b60
commit f63009a
Showing
5 changed files
with
68 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
nixos/modules/services/monitoring/prometheus/exporters/scaphandre.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ config | ||
, lib | ||
, pkgs | ||
, options | ||
}: | ||
|
||
let | ||
logPrefix = "services.prometheus.exporter.scaphandre"; | ||
cfg = config.services.prometheus.exporters.scaphandre; | ||
in { | ||
port = 8080; | ||
extraOpts = { | ||
telemetryPath = lib.mkOption { | ||
type = lib.types.str; | ||
default = "/metrics"; | ||
description = lib.mdDoc '' | ||
Path under which to expose metrics. | ||
''; | ||
}; | ||
}; | ||
|
||
serviceOpts = { | ||
serviceConfig = { | ||
ExecStart = '' | ||
${pkgs.scaphandre}/bin/scaphandre prometheus \ | ||
--address ${cfg.listenAddress} \ | ||
--port ${toString cfg.port} \ | ||
--suffix ${cfg.telemetryPath} \ | ||
${lib.concatStringsSep " \\\n " cfg.extraFlags} | ||
''; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters