Skip to content

How to expose Prometheus metrics manually? #1074

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

You must be logged in to vote

In general, you would need to follow the steps outlined in #1079 's description, but this question has come up so often that I went ahead for a simpler solution that will go out with Kamon 2.3.2:

Call PrometheusReporter.latestScrapeData() and you'll get back an Option[String]. If the Prometheus reporter is running then the option will be defined and contain the latest scrape data, otherwise it wont. On top of that, you could disable the built-in HTTP server using this setting:

kamon.prometheus {

  # Enable or disable publishing the Prometheus scraping enpoint using a embedded server.
  start-embedded-http-server = no
}

Stay alert for the 2.3.2 release!

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by PavelPenkov
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