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 test for cloudwatch2 counter that demonstrates #1295

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bernata
Copy link

@bernata bernata commented Jul 19, 2024

potential slice bug with label-values.
Label-values are stored in a Counter as a string slice and copyied over to a new Counter when With(lvs ...string) is invoked. The slice bug can present when the same Counter is copied twice with With() and each invocation does not resize the capacity of the slice.

potential slice bug with label-values.
Label-values are stored in a Counter as a string slice and
copyied over to a new Counter when With(lvs ...string) is
invoked. The slice bug can present when the same Counter is
copied twice with With() and each invocation does not resize
the capacity of the slice.
@bernata
Copy link
Author

bernata commented Jul 19, 2024

Hi @peterbourgon - thank you for contributing gokit; and all your contributions on advocating gokit and its surroundings [go, elegant design].
I wanted to get your thoughts on this test which I believe demonstrates a slice bug in some of the metrics Counter structures when the slice is not resized and two Counters refer to the same backing memory. Always using a new slice i think is the most straightforward fix. When you have a moment, it would be great to get your thoughts on this. Thank you again.

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

Successfully merging this pull request may close these issues.

1 participant