-
Notifications
You must be signed in to change notification settings - Fork 876
Allow duplicate instrument registration #2916
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
Merged
cijothomas
merged 30 commits into
open-telemetry:main
from
alanwest:alanwest/metric-identity
Mar 5, 2022
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
ac0e766
Allow duplicate instrument registration
alanwest 7fb51d0
Merge branch 'main' into alanwest/metric-identity
alanwest 27b595a
Merge branch 'main' into alanwest/metric-identity
cijothomas ceacd5f
Merge branch 'main' into alanwest/metric-identity
alanwest d4a45d0
Rename MetricIdentity to InstrumentIdentity
alanwest 0423b57
Handle duplicate instrument registration on views code path
alanwest 56e5313
Test identical instruments with no views
alanwest 024e947
Merge branch 'main' into alanwest/metric-identity
alanwest 134fc1b
Merge branch 'alanwest/metric-identity' of github.com:alanwest/opente…
alanwest dd19e28
Allow distinct metric streams with same name
alanwest d399bee
Add more tests
alanwest 445a3da
Merge branch 'main' into alanwest/metric-identity
alanwest 8062437
Update warning message
alanwest 37526c0
Merge branch 'main' into alanwest/metric-identity
alanwest 16b9b63
Fixx spelling
alanwest 1bfafc6
Update src/OpenTelemetry/Metrics/MetricReaderExt.cs
cijothomas 3642a3a
Update changelog
alanwest c69ed26
Merge remote-tracking branch 'upstream/main' into alanwest/metric-ide…
alanwest 8eec320
Hashtags: For more than just social media
alanwest 2dd0058
Fix view use case
alanwest 03a245e
Handle instruments with same name from meters with same name differen…
alanwest 0ff1d22
Clear InstrumentIdenity map when meter is disposed
alanwest 63bfe85
Merge remote-tracking branch 'upstream/main' into alanwest/metric-ide…
alanwest e52051d
Update public API
alanwest 90ced8c
Update changelog
alanwest 28aa3b3
Add additional clarification for duplicate instrument warning
alanwest 247b0d7
Private set
alanwest 683182e
Instrument name from InstrumentIdentity
alanwest ef836a7
Compute hash in constructor
alanwest 012f080
Merge branch 'main' into alanwest/metric-identity
utpilla File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Compute hash in constructor
- Loading branch information
commit ef836a7f0cdbe6bf5a8c17cd9c0d99e0bd28e998
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This is not quite right. The entire meter - that is, name, version, and schema url (when we eventually support it) should be a component of the identity. Fixing this...
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.
Fixed 03a245e
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.
Wouldn't it be better to just have
Meteras the onlypublicproperty in that case? We would only need to update theEquals()check like below:This way if schema url gets added to
Meterlater on, we don't have to add a newpublicproperty dedicated just for that.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.
Since this is an
internalstruct, it wouldn't matter as much if we have to add more properties later on, but I think we could just useMeterhere as it provides the best encapsulation for everythingMeterrelated.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.
Do you mean keep a handle on the
Meteritself? Same concern here #2916 (comment) would apply.Metermight be disposed so safer to not keep a handle on it.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.
Maybe it'd be less of a concern to keep a handle on the meter since
InstrumentIdentityis internal?Uh oh!
There was an error while loading. Please reload this page.
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.
Yeah, I was suggesting to have a handle to
Meteritself as all of this is happening in theInstrumentPublishedcallback so theMeterwould not be disposed in this path. But I overlooked the fact that in case of dictionary lookup collisions, theEqualscheck might fail as the dictionary might still have entries to instruments whoseMeters are disposed. This would only work if we can ensure that the dictionary would never have any instrument whoseMeteris disposed.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.
Okay to park this into an issue and come back to this ? (so that we can merge and do a release.)