mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 18:10:34 +01:00
0b4e03f5fc
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.
27 lines
806 B
Go
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")
|
|
}
|