strimzi / metrics-reporter

Prometheus Metrics Reporter for Apache Kafka server and client compoenents
Apache License 2.0
4 stars 7 forks source link

Remove HTTPServer from YammerPrometheusMetricsReporter #39

Closed mimaison closed 4 weeks ago

mimaison commented 4 weeks ago

Originally we only started the HTTP server in KafkaPrometheusMetricsReporter but I added logic to do it in YammerPrometheusMetricsReporter as well in https://github.com/strimzi/metrics-reporter/commit/586860c89e8d92c311902d3ecc2554702f974391 in order to ease testing.

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.

It's best to only have the HTTP server in KafkaPrometheusMetricsReporter as this has a clear lifecycle and has a close() method, so we'll be able to address https://github.com/strimzi/metrics-reporter/issues/34.