Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for promhttp #417

Open
jeffreyyong opened this issue Nov 28, 2018 · 2 comments
Open

Add support for promhttp #417

jeffreyyong opened this issue Nov 28, 2018 · 2 comments

Comments

@jeffreyyong
Copy link

InstrumentHandlerResponseSize func(obs prometheus.ObserverVec, next http.Handler) http.Handler from the promhttp package takes in "http.Handler" and returns a "http.Handler" for instrumenting the response size. However, martini only has martini.Handler which makes it impossible to pass into the promhttp instrumentation function, I'm wondering if it's possible to use martini with prometheus promhttp?

@jeffreyyong
Copy link
Author

Manage to make the Go programme compile, but when it's done like this:

m := martini.New()
m.Use(promhttp.InstrumentHandlerInFlight(metrics.RequestGauge, m))

The whole programme just gets stuck

@zoidyzoidzoid
Copy link

I was recently looking at adding opencensus instrumentation to orchestrator which uses Martini too. It suggests doing it passing in a custom http.Handler too here

Though I'm looking at writing my own middleware for it instead.

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

No branches or pull requests

2 participants