Fix lint
Marco Munizaga committed
Jul 25, 2022 at 10:51 UTC
550663fb738410e13b55de4660ed05b1405c1e89
1 file changed
+8
-2
core/node/libp2p/rcmgr.go
+8
-2
@@ -87,11 +87,17 @@ func ResourceManager(cfg config.SwarmConfig) interface{} {
87
}
88
89
// Hook up the trace reporter metrics
90
- view.Register(rcmgrObs.DefaultViews...)
91
- ocprom.NewExporter(ocprom.Options{
90
+ err = view.Register(rcmgrObs.DefaultViews...)
91
+ if err != nil {
92
+ return nil, opts, fmt.Errorf("registering rcmgr obs views: %w", err)
93
+ }
94
+ _, err = ocprom.NewExporter(ocprom.Options{
95
Registry: prometheus.DefaultRegisterer.(*prometheus.Registry),
96
Namespace: "rcmgr_trace_metrics",
97
})
98
+ if err != nil {
99
+ return nil, opts, fmt.Errorf("creating new prom exporter", err)
100
+ }
101
102
if os.Getenv("LIBP2P_DEBUG_RCMGR") != "" {
103
traceFilePath := filepath.Join(repoPath, NetLimitTraceFilename)