monitoring: add monitoring package for Prometheus metric exports.
This commit is contained in:
5 files changed
+169
No files matched your search
@@ -0,0 +1,25 @@
|
||||
// +build !monitoring
|
||||
|
||||
package monitoring
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"github.com/lightningnetwork/lnd/lncfg"
|
||||
)
|
||||
|
||||
// GetPromInterceptors returns the set of interceptors for Prometheus
|
||||
// monitoring if monitoring is enabled, else empty slices. Monitoring is
|
||||
// currently disabled.
|
||||
func GetPromInterceptors() ([]grpc.UnaryServerInterceptor, []grpc.StreamServerInterceptor) {
|
||||
return []grpc.UnaryServerInterceptor{}, []grpc.StreamServerInterceptor{}
|
||||
}
|
||||
|
||||
// ExportPrometheusMetrics is required for lnd to compile so that Prometheus
|
||||
// metric exporting can be hidden behind a build tag.
|
||||
func ExportPrometheusMetrics(_ *grpc.Server, _ lncfg.Prometheus) error {
|
||||
return fmt.Errorf("lnd must be built with the monitoring tag to " +
|
||||
"enable exporting Prometheus metrics")
|
||||
}
|
||||
Reference in new issue
Block a user