Fix usage of deprecated startMetricsHttpServer call (#2032)
This commit is contained in:
parent
f294d1e086
commit
be02242ccd
|
@ -308,15 +308,19 @@ proc run(config: PortalConf) {.raises: [CatchableError].} =
|
||||||
let
|
let
|
||||||
address = config.metricsAddress
|
address = config.metricsAddress
|
||||||
port = config.metricsPort
|
port = config.metricsPort
|
||||||
info "Starting metrics HTTP server",
|
|
||||||
url = "http://" & $address & ":" & $port & "/metrics"
|
url = "http://" & $address & ":" & $port & "/metrics"
|
||||||
|
|
||||||
|
server = MetricsHttpServerRef.new($address, port).valueOr:
|
||||||
|
error "Could not instantiate metrics HTTP server", url, error
|
||||||
|
quit QuitFailure
|
||||||
|
|
||||||
|
info "Starting metrics HTTP server", url
|
||||||
try:
|
try:
|
||||||
chronos_httpserver.startMetricsHttpServer($address, port)
|
waitFor server.start()
|
||||||
except CatchableError as exc:
|
except MetricsError as exc:
|
||||||
raise exc
|
fatal "Could not start metrics HTTP server",
|
||||||
# TODO: Ideally we don't have the Exception here
|
url, error_msg = exc.msg, error_name = exc.name
|
||||||
except Exception as exc:
|
quit QuitFailure
|
||||||
raiseAssert exc.msg
|
|
||||||
|
|
||||||
## Starting the different networks.
|
## Starting the different networks.
|
||||||
d.start()
|
d.start()
|
||||||
|
|
|
@ -262,15 +262,19 @@ proc run(config: PortalCliConf) =
|
||||||
let
|
let
|
||||||
address = config.metricsAddress
|
address = config.metricsAddress
|
||||||
port = config.metricsPort
|
port = config.metricsPort
|
||||||
notice "Starting metrics HTTP server",
|
|
||||||
url = "http://" & $address & ":" & $port & "/metrics"
|
url = "http://" & $address & ":" & $port & "/metrics"
|
||||||
|
|
||||||
|
server = MetricsHttpServerRef.new($address, port).valueOr:
|
||||||
|
error "Could not instantiate metrics HTTP server", url, error
|
||||||
|
quit QuitFailure
|
||||||
|
|
||||||
|
info "Starting metrics HTTP server", url
|
||||||
try:
|
try:
|
||||||
chronos_httpserver.startMetricsHttpServer($address, port)
|
waitFor server.start()
|
||||||
except CatchableError as exc:
|
except MetricsError as exc:
|
||||||
raise exc
|
fatal "Could not start metrics HTTP server",
|
||||||
except Exception as exc:
|
url, error_msg = exc.msg, error_name = exc.name
|
||||||
raiseAssert exc.msg
|
quit QuitFailure
|
||||||
# TODO fix metrics
|
|
||||||
|
|
||||||
case config.cmd
|
case config.cmd
|
||||||
of ping:
|
of ping:
|
||||||
|
|
Loading…
Reference in New Issue