lnd/monitoring/monitoring_off.go
Oliver Gugger 0b4e03f5fc
multi: add golang 1.17 compatible build tags
With go 1.17 a change to the build flags was implemented:
https://go.googlesource.com/proposal/+/master/design/draft-gobuild.md

The formatter now automatically adds the forward-compatible build tag
format and the linter checks for them, so we need to include them in our
code.
2021-09-29 17:31:37 -07:00

27 lines
806 B
Go

//go:build !monitoring
// +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")
}