Skip to content

Expose JMX metrics in Kamon prometheus exporter #1105

Answered by ivantopo
sebarys asked this question in Q&A
Discussion options

You must be logged in to vote

There is no automatic way to turn JMX attributes into metrics in Kamon 2.x. We used to have something like that in 1.x, but we never got to upgrade it. I'm personally not a fan of using JMX to expose metrics because the only things that sort of make sense to expose are monotonic counters and gauges, and there were not that many people using it so we will probably not upgrade ourselves (open to contributions, though).

That said, I wanted to see how hard would it be to take the values exposed by Slick's AsyncExecutorMXBean and turn them into Kamon gauges that get exposed to every reporter. Turns out it is not that complicated! It all boils down to these two functions:

  def registerBean(): U…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@sebarys
Comment options

@ivantopo
Comment options

Answer selected by sebarys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants