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

Counter initialization #260

Closed
DifferentialOrange opened this issue Jul 9, 2021 · 0 comments · Fixed by #288
Closed

Counter initialization #260

DifferentialOrange opened this issue Jul 9, 2021 · 0 comments · Fixed by #288
Labels
customer feature A new functionality

Comments

@DifferentialOrange
Copy link
Member

It is implied that counter start from 0, since counter value after its first inc(1) will be 1.

But metric value do not exist until first inc() call (since there are no other methods to change counter metric value). So if value if never changed, metric will be null.

For example, it is a common case to count process errors with counter. But if we did not have any errors from the start, the metric will be null. HTTP activity is the same (#96): it is more convenient to know that we had 0 requests on some route rather then no data. No data if often treated like "there is something wrong with metric retrieval" rather then "it's a plain zero".

It is now possible to initialize counter with specific labels with

counter:inc(0, label_pairs)

but it is definitely a duct tape. It would be better to support this behavior explicitly, e.g. with some collector method.

@DifferentialOrange DifferentialOrange added feature A new functionality customer labels Jul 9, 2021
@kyukhin kyukhin added the teamS label Aug 13, 2021
This was referenced Aug 16, 2021
@kyukhin kyukhin added this to the wishlist milestone Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer feature A new functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants