Mr Shorly
Mr Shorly

Reputation: 149

Start prometheus within spring application

I'm new to micrometer and Prometheus, I only used dropwizards metrics. It bothers me a bit, that I actually need to have 3 different instances up and running to see the metrics

With dropwizard I could expose aggregated metrics right away.

That is, why I was curious about whether it would be possible to start Prometheus together with my spring boot application to expose nicely aggregated data right away. So far I couldn't find anything useful so I hope someone here might be able to help me.

Upvotes: 0

Views: 263

Answers (1)

checketts
checketts

Reputation: 14943

Welcome to Microservices. Prometheus is written in Go, so Java won't be able to start it, though you could use something like TestContainers (a Java library for starting Docker containers) to start up a Prometheus instance for you.

If you don't want Prometheus itself, you could startup a SimpleMeterRegistry, or a LoggingMeterRegistry that do some lightweight aggregations within your app (you may need to extend them to get exactly what you are looking for).

There is even a DropWizard based registry, but I haven't played with that one.

Upvotes: 2

Related Questions