mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-30 07:35:07 +02:00
Merge pull request #6224 from Roasbeef/prometheus-latency-histograms
monitoring+cfg: add new option to export gRPC perf metrics
This commit is contained in:
@@ -35,6 +35,14 @@ func ExportPrometheusMetrics(grpcServer *grpc.Server, cfg lncfg.Prometheus) erro
|
||||
|
||||
grpc_prometheus.Register(grpcServer)
|
||||
|
||||
// Enable the histograms which can allow plotting latency
|
||||
// distributions of inbound calls. However we guard this behind
|
||||
// another flag as this can generate a lot of additional data,
|
||||
// as its a high cardinality metric typically.
|
||||
if cfg.PerfHistograms {
|
||||
grpc_prometheus.EnableHandlingTimeHistogram()
|
||||
}
|
||||
|
||||
http.Handle("/metrics", promhttp.Handler())
|
||||
go func() {
|
||||
http.ListenAndServe(cfg.Listen, nil)
|
||||
|
Reference in New Issue
Block a user