-
Notifications
You must be signed in to change notification settings - Fork 657
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
Consider renaming observable callback return type from Measurement -> Observation #2451
Comments
Hm, another question first, why do we have an implementation of the 🤔 Should we have an abstract |
They are more or less unrelated, just share the same name, which is why I think renaming the Observable callback one to |
We will probably need to rework this API regardless to handle multi-instrument callbacks. See open-telemetry/opentelemetry-specification#2317 (comment) |
@aabmass |
I don't disagree, I am just curious why do we have an implementation in the API 🤷 If we decide to have only an implementation in the SDK, should we have there two classes with the same attributes but different names? |
What do you mean when you say "why do we have an implementation in the API"? If there was no such class |
This is an enlightening question 👍 The idea that I have of the API (and thinking about error handling lead me into this idea) is that it contains 4 things:
In the case of Now, I think for consistency with this idea, a |
This falls under 4, it is a concrete class in the API that is used as part of instrumentation. It is not in the spec explicitly because the spec is very flexible. Here's the API spec for this:
Instead of a tuple of value and attributes, we provide |
Is the motivation for this change related to this topic? I don't necessarily disagree with having a class named |
As mentioned in the SIG, the SDK |
@aabmass @ocelotl Should we move actual Measurement to api since it is defined in the api specs? |
If I remember correctly, we have found situations before where it was ok that something defined in the api document was implemented in the sdk document, so I think it is ok to have that in the api or in the sdk. |
* Rename Measurement to Observation Fixes #2451 * Fix docs * Update CHANGELOG.md Co-authored-by: Leighton Chen <[email protected]> * Update CHANGELOG.md Co-authored-by: Leighton Chen <[email protected]> * Fix examples Co-authored-by: Leighton Chen <[email protected]>
opentelemetry-python/opentelemetry-api/src/opentelemetry/_metrics/measurement.py
Line 20 in fd9862a
To differentiate this from the SDK's internal
Measurement
class, we could rename this class to Observation, as it is the thing returned from observable instruments' callback methods. Complete example of an observable instrument:Thoughts?
The text was updated successfully, but these errors were encountered: