diff --git a/collectors/prometheus.go b/collectors/prometheus.go index 2f87472..cb13d64 100644 --- a/collectors/prometheus.go +++ b/collectors/prometheus.go @@ -67,6 +67,9 @@ type MonitoringConfig struct { // DisableGraph disables collection of graph metrics DisableGraph bool + + // DisableHtlc disables collection of HTLCs metrics + DisableHtlc bool } func DefaultConfig() *PrometheusConfig { @@ -101,9 +104,12 @@ func NewPrometheusExporter(cfg *PrometheusConfig, lnd *lndclient.LndServices, NewPeerCollector(lnd.Client, errChan), NewInfoCollector(lnd.Client, errChan), }, - htlcMonitor.collectors()..., ) + if !monitoringCfg.DisableHtlc { + collectors = append(collectors, htlcMonitor.collectors()...) + } + if !monitoringCfg.DisableGraph { collectors = append(collectors, NewGraphCollector(lnd.Client, errChan)) } diff --git a/config.go b/config.go index 774ca9d..9c8d53e 100755 --- a/config.go +++ b/config.go @@ -49,8 +49,11 @@ type config struct { // PrimaryNode is the pubkey of the primary node in primary-gateway setups. PrimaryNode string `long:"primarynode" description:"Public key of the primary node in a primary-gateway setup"` - // DisableGraph disables collection of graph metrics + // DisableGraph disables collection of graph metrics. DisableGraph bool `long:"disablegraph" description:"Do not collect graph metrics"` + + // DisableHtlc disables the collection of HTLCs metrics. + DisableHtlc bool `long:"disablehtlc" description:"Do not collect HTLCs metrics"` } var defaultConfig = config{ diff --git a/lndmon.go b/lndmon.go index 85af1a4..bcf062b 100755 --- a/lndmon.go +++ b/lndmon.go @@ -59,6 +59,7 @@ func start() error { monitoringCfg := collectors.MonitoringConfig{ DisableGraph: cfg.DisableGraph, + DisableHtlc: cfg.DisableHtlc, } if cfg.PrimaryNode != "" { primaryNode, err := route.NewVertexFromStr(cfg.PrimaryNode)