java-metrics icon indicating copy to clipboard operation
java-metrics copied to clipboard

Issue getting beans to autoconfigure

Open tvfoodmaps opened this issue 6 years ago • 4 comments

I am trying to add metrics to my spring boot app (already working with Jaegar for traces and working with micrometer for standard spring actuators).

When I add

compile('io.opentracing.contrib:opentracing-metrics-prometheus-spring-autoconfigure:0.3.0') to my gradle file it replaces the original spring data at /actuators/prometheus.

If I remove that instead add a bean:

@Bean public MetricsFactory metricsFactory() { return new MicrometerMetricsFactory(); }

I see some jaeger metrics but none of the per span information I'm interested in. What I would like is to have /actuators/prometheus show both the standard spring metrics AND the jaegar, per-span, info. Any assistance is appreciated.

tvfoodmaps avatar Dec 13 '18 17:12 tvfoodmaps

@tvfoodmaps Thanks for reporting this. Unfortunately will not be able to investigate until the new year.

Would you be interested in providing a PR?

objectiser avatar Dec 14 '18 12:12 objectiser

Would love to begin to contribute. I don't think there is PR for code, I ended up getting this working with a lot of trial and error so if anything I think there is perhaps some documentation updates needed.

Also to keep the trail complete, I also had this issue as I was confused which of the projects was causing an issue. https://github.com/opentracing-contrib/java-spring-jaeger/issues/31#issuecomment-447235022

Perhaps improved documentation around how these various projects interact would be helpful.

tvfoodmaps avatar Dec 14 '18 18:12 tvfoodmaps

@tvfoodmaps Would be great if you could provide a docs PR improving areas where you had problems.

objectiser avatar Dec 17 '18 09:12 objectiser

@tvfoodmaps How did you get it to work. Please share sample code

himanshumps avatar Feb 23 '20 07:02 himanshumps