Skip to content
This repository has been archived by the owner on Mar 31, 2020. It is now read-only.

akka-http integration #9

Closed
rpankajakshan opened this issue Jan 29, 2018 · 7 comments
Closed

akka-http integration #9

rpankajakshan opened this issue Jan 29, 2018 · 7 comments

Comments

@rpankajakshan
Copy link

I am currently using
https://github.com/MonsantoCo/kamon-prometheus
which provides a way to integrate with akka-http. It will be nice to have the same feature in this module.

Regards

@StephenKing
Copy link
Contributor

What are you missing?

@rpankajakshan
Copy link
Author

I need to be able to run the prometheus endpoint on the same port as of the host server not a different one.

@ivantopo
Copy link
Contributor

That is possible at the moment. Take a look here, that is there precisely to allow for these cases in which you want to just expose the Prometheus data through some different route/toolkit in your app.

You will still have to create and add the PrometheusReporter instance to Kamon, but you can keep a reference to that reporter instance and call scrapeData() to get the actual String that should be exposed, then publish in whatever way your HTTP framework allows you.

Out of curiosity, on what are you planning to expose this? Play? Akka HTTP or some other? Maybe we should put up a example on how to do this.

@rpankajakshan
Copy link
Author

@ivantopo thanks for the pointer. I am using akka http server

@Camsteack
Copy link

Camsteack commented Apr 27, 2018

Hi,

I am trying to do the same but there doesn't seem to be a way to do that without having to start the embedded server even if you are not using it ? When I add the configuration not to start the embedded server I am not getting any data from scrapeData()

Is there a way to get data without have to start the server ? Many thanks

@thjaeckle
Copy link

I am interested in the same as @Camsteack
Did you figure it out? Is there a possibility to exclude the "nanohttpd" dependency and still get the metrics?

@eshepelyuk
Copy link

eshepelyuk commented Feb 11, 2019

@rpankajakshan why is this closed ?
The need for separate embedded server to just expose metrics is definately an overhead. It should be possible to expose metrics via application main HTTP engine (akka HTTP for instance).
Or at least it should be possible to exclude nanohttpd dependency from build artifacts.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants