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

Remove guage & add Observer metric instrument #498

Merged
merged 7 commits into from
Feb 26, 2020

Conversation

MikeGoldsmith
Copy link
Member

Fixes #497.

@MikeGoldsmith
Copy link
Member Author

Interestingly, I'm seeing intermittent failures for the three metric tests locally. MeterSdk uses a ConcurrentDictionary to manage each metric type, using LabelSetSdk as the key which overrides GetHashCode to use a constructed string from the labels (eg label1=value1,label2=value2). The failure indicates the oder of the metric entries to be at fault.

@MikeGoldsmith
Copy link
Member Author

PS the tests were previously ignored.

@MikeGoldsmith
Copy link
Member Author

Figured out the problem - the assert statements are using indexes into the dictionary but it's not sorted. This means the order is not guranteed based on the GetHashCode value.

Working on refactoring all three metric types' tests to not depend on order.

@MikeGoldsmith
Copy link
Member Author

The unit tests are now working as expected.

@MikeGoldsmith
Copy link
Member Author

@SergeyKanzhelev @cijothomas Ready for review 👍

@SergeyKanzhelev SergeyKanzhelev merged commit 677c5ae into open-telemetry:master Feb 26, 2020
@MikeGoldsmith MikeGoldsmith deleted the remove-guage branch February 27, 2020 16:55
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.

Replace gauge with observer metric instrument
3 participants