However YammerPrometheusMetricsReporter does not have a close() method which makes it awkward to properly manage the lifecycle of the HTTPServer instance. The HTTP server is already started in KafkaPrometheusMetricsReporter which covers both servers and client side component.
Originally we only started the HTTP server in
KafkaPrometheusMetricsReporter
but I added logic to do it inYammerPrometheusMetricsReporter
as well in https://github.com/strimzi/metrics-reporter/commit/586860c89e8d92c311902d3ecc2554702f974391 in order to ease testing.However
YammerPrometheusMetricsReporter
does not have aclose()
method which makes it awkward to properly manage the lifecycle of theHTTPServer
instance. The HTTP server is already started inKafkaPrometheusMetricsReporter
which covers both servers and client side component.It's best to only have the HTTP server in
KafkaPrometheusMetricsReporter
as this has a clear lifecycle and has aclose()
method, so we'll be able to address https://github.com/strimzi/metrics-reporter/issues/34.