hydra-queue-runner: get the listening port from the exposer itself
Otherwise, when the port is randomly chosen (e.g. by specifying no port, or a port of 0), it will just show that the port is 0 and not the port that is actually serving the metrics.
This commit is contained in:
parent
52a29d43e6
commit
c0f826b92d
|
@ -760,12 +760,13 @@ void State::run(BuildID buildOne)
|
||||||
throw Error("hydra-queue-runner is already running");
|
throw Error("hydra-queue-runner is already running");
|
||||||
|
|
||||||
/* Set up simple exporter, to show that we're still alive. */
|
/* Set up simple exporter, to show that we're still alive. */
|
||||||
std::string metricsAddress{"127.0.0.1:" + std::to_string(metricsPort)};
|
std::string metricsAddress{"127.0.0.1"};
|
||||||
prometheus::Exposer exposer{metricsAddress};
|
prometheus::Exposer exposer{metricsAddress + ":" + std::to_string(metricsPort)};
|
||||||
|
auto exposerPort = exposer.GetListeningPorts().front();
|
||||||
exposer.RegisterCollectable(registry);
|
exposer.RegisterCollectable(registry);
|
||||||
|
|
||||||
std::cout << "Starting the Prometheus exporter, listening on "
|
std::cout << "Starting the Prometheus exporter, listening on "
|
||||||
<< "http://" << metricsAddress << "/metrics"
|
<< "http://" << metricsAddress << ":" << exposerPort << "/metrics"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|
||||||
Store::Params localParams;
|
Store::Params localParams;
|
||||||
|
|
Loading…
Reference in a new issue