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 d64f297
Showing
5 changed files
with
66 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
31 changes: 31 additions & 0 deletions
31
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,31 @@ | ||
{ config, lib, pkgs, options }: | ||
|
||
with lib; | ||
|
||
let | ||
logPrefix = "services.prometheus.exporter.scaphandre"; | ||
cfg = config.services.prometheus.exporters.scaphandre; | ||
in { | ||
port = 8080; | ||
extraOpts = { | ||
telemetryPath = mkOption { | ||
type = 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} \ | ||
${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