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

Measurement should be a concrete class in the API not an abc #2150

Closed
2 tasks done
Tracked by #2140
aabmass opened this issue Sep 24, 2021 · 0 comments
Closed
2 tasks done
Tracked by #2140

Measurement should be a concrete class in the API not an abc #2150

aabmass opened this issue Sep 24, 2021 · 0 comments
Assignees
Labels

Comments

@aabmass
Copy link
Member

aabmass commented Sep 24, 2021

Since Measurements are returned directly by the user specified callbacks to async instruments, Measurement should be a concrete class in the API.

def my_observable_counter_callback() -> Iterable[Measurement]:
    return [
        # the instrumentation needs to instantiate and return this directly
        Measurement(123, {"foo": "bar"}),
        ...
    ]

meter.create_observable_counter("my_observable_counter", callback=my_observable_counter_callback)

spec: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#measurement

  • make Measurement a concrete class
  • remove ChildMeasurement from tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant