Skip to content

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

Closed
@aabmass

Description

@aabmass

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions