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

Expose in-built _request-observer_ #47

Closed
dchambers opened this issue Dec 19, 2018 · 3 comments
Closed

Expose in-built _request-observer_ #47

dchambers opened this issue Dec 19, 2018 · 3 comments

Comments

@dchambers
Copy link

Is your feature request related to a problem? Please describe.
I'm trying to implement Prometheus according to my company's standard requirements, but this requires me to also provide details of outbound client network requests using the same metric as is used for in-bound server network requests -- using a role label of client instead of the server value used for in-bound requests.

Describe the solution you'd like
In just 3 hours I've been able to configure promster to meet the fairly exacting standards docs at my company except this one small detail 🙌. If the observeRequest request-observer was exposed on app.locals in the same way as prom-client is, then I'd now be fully compliant 😄.

Any chance you'd consider exposing this observer too? Thanks in advance, Dominic.

Describe alternatives you've considered
The only alternative I can think of is to fork as I don't think it's possible for me to grab this reference any other way.

Additional context
None.

@tdeekens
Copy link
Owner

Thanks for reporting. Doesnt sound impossible. I will verify this the coming days to see what I can do.

@tdeekens
Copy link
Owner

I added a PR at #48. Can you verify there if this is what you would need? Lastly, I don't think I fully understand what this enables you to do. Can you maybe explain a bit more with a concrete example? Thanks.

tdeekens added a commit that referenced this issue Dec 24, 2018
- Closes #47 

#### Summary

This pull request adds exposing the `observeRequest` function (from `createRequestObserver`) on the locals or server (depending if express or Hapi).
@tdeekens
Copy link
Owner

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