-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Unexpected behavior of Collect for curried vector #1700
Comments
Hello, @palage4a! I'm here to help with any coding bugs, questions, or contributions. Let's tackle this issue together! The behavior you're observing is due to how the If your goal is to collect metrics independently based on the curried labels, you might need to filter the collected metrics manually after collection. The To achieve your goal, you can iterate over the collected metrics and filter them based on the label values you're interested in. This way, you can separate the metrics for "success" and "failure" as needed. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
👋🏽 So Dosubot was kind of correct, it's an intended and documented behavior of
For your test indeed I think I would do what Dosu suggests, so not curry, but write your own helper to sum all codes e.g. using I do agree however, that it can be non-intuitive -- I initially expected collection to be "curried" too and I don't see immediate reason why not, maybe @beorn7 recall. If we think it's a bug I think it's doable to implement It's also true, that you should never call WDYT? |
Hi @bwplotka. Thank you for the explanation.
Actually, i am trying to do weird stuff: i use prometheus as metric registry for my load testing tool not only for collecting it with prometheus server, but i also need print some output in terminal. That's why i have to collect data with So my goal in this issue: highlight the unexpected behavior and get maintainer's opinion on this case. I understand this use of |
I don't think there could be an “intuitive” behavior of the The decision to make the currying just some kind of facade modifying the access to metric elements (but not the collection) also allows a simpler and low-overhead implementation. Otherwise, separate pools of metric elements needed to be maintained to deliver the desired behavior (which isn't even clear, see above). I tried to be concise yet clear in the documentation:
|
Hi there. I am expecting that after currying a metric vector, i would able to collect metrics only for curried version of vector.
Here is representation of my expectations in test.
Library version: v1.19.0.
Mb i am trying the wrong stuff in the first place? My general goal - get count of successed/failed requests independently to response code (i deleted "code" label for in favor of test example).
The text was updated successfully, but these errors were encountered: