-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Introduce metric constructor errors, MeterMust
wrapper
#529
Conversation
This is now a WIP having received feedback on Gitter, see https://gitter.im/open-telemetry/opentelemetry-go?at=5e66b07cff8bf14a54470408 |
Must
variationsMust
variations
216bc8b
to
3fc1244
Compare
Must
variationsMust
wrapper
@MrAlias I moved the PTAL |
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.
Looks good, but I have some questions.
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.
I think this is a positive approach in general, I have a few questions about the implementation though.
The breaking apart of the Meter
interface seems a bit like it is bloating the API with interfaces that will not be used and seems a bit concerning. I'm interested in the answer to @krnowak's question about whether the *Must
interfaces could just be concret type or not.
As for the changes to include the Must
function, I think that looks like a positive move.
Must
wrapperMeterMust
wrapper
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.
One nit found.
Removed a sentence that was no longer true.
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.
Awesome work, and thanks for putting up with my pestering! 😄
Thanks for putting up with my rushing. 😀 |
…try#529) * Update api for Must constructors, with SDK helpers * Update for Must constructors, leaving TODOs about global errors * Add tests * Move Must methods into metric.Must * Apply the feedback * Remove interfaces * Remove more interfaces * Again... * Remove a sentence about a dead inteface
This is a partial implementation for #514. It will be easier if we introduce the API change in one PR and implement error checking in a second PR.
This introduces
metric.Must()
to wrap a Meter so that its instrument constructors return an error.Also, #174 is mentioned because there is a new requirement for the global package to handle errors that might occur during deferred constructors.
Note this retains some refactoring of the
Meter
API into Measure and Observer constructor sub-interfaces. This adopts the terminology that has been developed in open-telemetry/oteps#88, calling the new constructors eitherMeasure
orObserver
type.