github.com/decred/dcrlnd@v0.7.6/lncfg/monitoring_on.go (about)

     1  //go:build monitoring
     2  // +build monitoring
     3  
     4  package lncfg
     5  
     6  // Prometheus is the set of configuration data that specifies the listening
     7  // address of the Prometheus exporter.
     8  type Prometheus struct {
     9  	// Listen is the listening address that we should use to allow the main
    10  	// Prometheus server to scrape our metrics.
    11  	Listen string `long:"listen" description:"the interface we should listen on for Prometheus"`
    12  
    13  	// Enable indicates whether to export lnd gRPC performance metrics to
    14  	// Prometheus. Default is false.
    15  	Enable bool `long:"enable" description:"enable Prometheus exporting of lnd gRPC performance metrics."`
    16  }
    17  
    18  // DefaultPrometheus is the default configuration for the Prometheus metrics
    19  // exporter.
    20  func DefaultPrometheus() Prometheus {
    21  	return Prometheus{
    22  		Listen: "127.0.0.1:8989",
    23  		Enable: false,
    24  	}
    25  }
    26  
    27  // Enabled returns whether or not Prometheus monitoring is enabled. Monitoring
    28  // is disabled by default, but may be enabled by the user.
    29  func (p *Prometheus) Enabled() bool {
    30  	return p.Enable
    31  }