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
New Default Metric: Requests In Progress #27
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @scotgopal I think this is a great idea, thanks for contributing this.
I made some suggestion comments to update the new metric name to requests_in_progress
.
It'd be nice to get at least one unit test for this as well. If you are able to do that then great, if not, I can probably add one on the weekend.
Co-authored-by: Steve Hillier <stephenhillier@gmail.com>
Co-authored-by: Steve Hillier <stephenhillier@gmail.com>
Co-authored-by: Steve Hillier <stephenhillier@gmail.com>
Co-authored-by: Steve Hillier <stephenhillier@gmail.com>
Thanks a lot for the suggestions and comments @stephenhillier . I'd work on creating a unit test tomorrow and will do a commit to this branch. |
Hello @stephenhillier . I realized that there had been a mistake during the last test. I've installed the package from pip instead of installing it from the dev folder using Guess I will have to fix that before making new tests. Talking about the test for the new default metrics: requests_in_progress, I had an idea of testing it by:
What do you think about this idea? Also could you guide on how to simulate concurrent requests? |
That's worth a try. I previously used sleep(0.1) for another test; that should be plenty long enough to keep the gauge incremented. As soon as I get a chance to sit down tonight or tomorrow I'll try out a couple ways of triggering the gauge and let you know. |
Ah ok, creating the There are a couple tests that ensure that the path label is not populated with paths that don't exist (to prevent unbounded label cardinality), but we don't know that until the end of the request (at least not the way it's currently set up). What do you think about excluding the |
There's a really basic example of a test for this PR in this commit (on a separate branch): ca5e46f The test could be improved, however, I think this at least tests that the gauge was incremented and then decremented. |
Hey there. I think excluding the path label will increment the gauge for calls to every endpoint in the server. We can opt to do it this way as a temporary fix and to make this default metric available to the users. This info will still be useful to people. But what I had in mind when I came up with the idea was that by using the path label, users will have the capability to know which endpoint is the most active at a given time. Also, different endpoints may process input at different speeds, so without being able to filter by path, we wouldn't know which endpoint is still processing and which endpoint is done. |
Ok, that sounds good. |
Wonderful. Glad to know we're on the same page for this feature. I am also feeling lucky to have my first contribution to be quite useful. 😇 Thanks for this opportunity. Let's merge this in for now.💪 |
Do you want to |
To be honest, I never heard of |
Do let me know if I missed anything out @stephenhillier . |
Addressed issue #26 in this PR. Along with that, I've made some additional changes too.
requirements.txt
.README.md
.This is my very first contribution to an external open source project. Feel free to comment on the contribution and I'll be glad to learn and improve. Thank you.