Add gRPC performance Prometheus exporter.#3134
Add gRPC performance Prometheus exporter.#3134Roasbeef merged 2 commits intolightningnetwork:masterfrom
Conversation
monitoring/config.go
Outdated
| @@ -0,0 +1,9 @@ | |||
| package monitoring | |||
|
|
|||
| // PrometheusConfig is the set of configuration data that specifies | |||
There was a problem hiding this comment.
Alternatively, this can live in lncfg and have two versions: one with w/ the build tag, and one w/o it. This way, if the user doesn't have this tag enabled, then it won't show up in lnd -h.
There was a problem hiding this comment.
IIUC, fixed.
rpcserver.go
Outdated
| case macService != nil: | ||
| unaryInterceptor = macService.UnaryServerInterceptor(permissions) | ||
| streamInterceptor = macService.StreamServerInterceptor(permissions) | ||
| case monitoring.Enabled: |
There was a problem hiding this comment.
Rather than check this manually here independent of the build tag, I think this can be melded in with the current monitoring.Start method.
There was a problem hiding this comment.
Hm, server options need to be set before any services can register with the grpc server. Lmk if my solution works.
0c2ca1b to
9fc1a34
Compare
b409d45 to
5e8a404
Compare
Roasbeef
left a comment
There was a problem hiding this comment.
Diff looking much better now IMO, few more final comments, and then I think this is ready to land
858a13c to
9b44375
Compare
9c367ca to
920919d
Compare
monitoring/monitoring_off.go
Outdated
There was a problem hiding this comment.
should this method possibly return an error if called on !monitoring build?
Start the Prometheus exporter in rpcserver.go if monitoring is enabled through the build tag. Also allow users to specify what address they want the Prometheus exporter to be listening on.
920919d to
f5eeb05
Compare
Optionally export lnd gRPC performance metrics for use by a Prometheus server through gRPC interceptors.
If the user compiles
lndwith themonitoringtag, the exporter will automatically start listening for Prometheus requests whenlndstarts up. The user has the option of specifying an address for the exporter to listen on, with the default beinglocalhost:8989.