-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89449 from mmilata/lnd-exporter
nixos/prometheus-lnd-exporter: init
- Loading branch information
Showing
5 changed files
with
114 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,7 @@ let | |
"fritzbox" | ||
"json" | ||
"keylight" | ||
"lnd" | ||
"mail" | ||
"mikrotik" | ||
"minio" | ||
|
46 changes: 46 additions & 0 deletions
46
nixos/modules/services/monitoring/prometheus/exporters/lnd.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,46 @@ | ||
{ config, lib, pkgs, options }: | ||
|
||
with lib; | ||
|
||
let | ||
cfg = config.services.prometheus.exporters.lnd; | ||
in | ||
{ | ||
port = 9092; | ||
extraOpts = { | ||
lndHost = mkOption { | ||
type = types.str; | ||
default = "localhost:10009"; | ||
description = '' | ||
lnd instance gRPC address:port. | ||
''; | ||
}; | ||
|
||
lndTlsPath = mkOption { | ||
type = types.path; | ||
description = '' | ||
Path to lnd TLS certificate. | ||
''; | ||
}; | ||
|
||
lndMacaroonDir = mkOption { | ||
type = types.path; | ||
description = '' | ||
Path to lnd macaroons. | ||
''; | ||
}; | ||
}; | ||
serviceOpts.serviceConfig = { | ||
ExecStart = '' | ||
${pkgs.prometheus-lnd-exporter}/bin/lndmon \ | ||
--prometheus.listenaddr=${cfg.listenAddress}:${toString cfg.port} \ | ||
--prometheus.logdir=/var/log/prometheus-lnd-exporter \ | ||
--lnd.host=${cfg.lndHost} \ | ||
--lnd.tlspath=${cfg.lndTlsPath} \ | ||
--lnd.macaroondir=${cfg.lndMacaroonDir} \ | ||
${concatStringsSep " \\\n " cfg.extraFlags} | ||
''; | ||
LogsDirectory = "prometheus-lnd-exporter"; | ||
ReadOnlyPaths = [ cfg.lndTlsPath cfg.lndMacaroonDir ]; | ||
}; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ stdenv, buildGoModule, fetchFromGitHub }: | ||
|
||
buildGoModule rec { | ||
pname = "lndmon-unstable"; | ||
version = "2020-01-09"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "lightninglabs"; | ||
repo = "lndmon"; | ||
sha256 = "0d4z8yv2459wsi4c91qs5an13acn73fd8s321xya5vxxiyf51q24"; | ||
rev = "2c7c5ce0fcb4e7eef4df60efe8a644587a309f6c"; | ||
}; | ||
|
||
vendorSha256 = "083h2ksnqmcr48958r5pag9a28xvljpc3prip6wn70ifp2wpjpin"; | ||
|
||
meta = with stdenv.lib; { | ||
inherit (src.meta) homepage; | ||
description = "Prometheus exporter for lnd (Lightning Network Daemon)"; | ||
license = licenses.mit; | ||
maintainers = with maintainers; [ mmilata ]; | ||
}; | ||
} |
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