1
1
package monitoring
2
2
3
3
import (
4
- "context"
5
4
"fmt"
6
5
"net/http"
7
6
"net/url"
@@ -12,12 +11,13 @@ import (
12
11
"github.com/smartcontractkit/chainlink-common/pkg/logger"
13
12
commonMonitor "github.com/smartcontractkit/chainlink-common/pkg/monitoring"
14
13
"github.com/smartcontractkit/chainlink-common/pkg/monitoring/config"
14
+ "github.com/smartcontractkit/chainlink-common/pkg/services"
15
15
)
16
16
17
17
// Builds monitor instance with only the prometheus exporter.
18
18
// Does not contain kafka exporter.
19
19
func NewMonitorPrometheusOnly (
20
- rootCtx context. Context ,
20
+ stopCh services. StopRChan ,
21
21
log commonMonitor.Logger ,
22
22
chainConfig commonMonitor.ChainConfig ,
23
23
envelopeSourceFactory commonMonitor.SourceFactory ,
@@ -62,7 +62,7 @@ func NewMonitorPrometheusOnly(
62
62
)
63
63
64
64
// Configure HTTP server
65
- httpServer := commonMonitor .NewHTTPServer (rootCtx , cfg .HTTP .Address , logger .With (log , "component" , "http-server" ))
65
+ httpServer := commonMonitor .NewHTTPServer (stopCh , cfg .HTTP .Address , logger .With (log , "component" , "http-server" ))
66
66
httpServer .Handle ("/metrics" , metrics .HTTPHandler ())
67
67
httpServer .Handle ("/debug" , manager .HTTPHandler ())
68
68
// Required for k8s.
@@ -71,7 +71,7 @@ func NewMonitorPrometheusOnly(
71
71
}))
72
72
73
73
return & commonMonitor.Monitor {
74
- RootContext : rootCtx ,
74
+ StopCh : stopCh ,
75
75
ChainConfig : chainConfig ,
76
76
Config : cfg ,
77
77
Log : log ,
0 commit comments