Hi All I'm working on designing a Kubernetes sidecar / Adapter pattern for the Spring Boot Application to export Prometheus metrics, I am aware that we can use maven dependency
io.micrometer:micrometer-registry-prometheus to expose Prometheus metrics directly. However, with my limited knowledge, I got to know adapter/sidecar patterns we can extend apps in Kubernetes without changing the code. Being new to the Kubernetes concept I am struggling to figure out whether it can be achieved to adapter/sidecar pattern or not.
With my research, I find out example to expose Elasticsearch Prometheus metrics using adapter pattern example where Elasticsearch does not support natively exporting Prometheus metrics.
I need help with the following points
- Since Spring Boot provides a way to export Prometheus metrics using a micrometer, is it the correct approach to use a sidecar/adapter pattern to export metrics?
- if yes can you please guide me on how can we achieve this using the sidecar/adapter pattern in Kubernetes?
- any example would be great help.