Skip to content

Metrics instances can be created by direct instantiation #2550

@ocelotl

Description

@ocelotl

From the spec:

New Meter instances are always created through a MeterProvider

In our SDK, Meter (and other classes) can be instantiated directly, by importing the SDK Meter class and instantiating it, bypassing the MeterProvider. This is relevant to error handling, if we allow Meter to be instantiated directly, it may raise errors if the user passes bad parameters. If such thing happened using MeterProvider, the get_meter method could catch this errors and return a NoOpMeter.

Metadata

Metadata

Assignees

Labels

metricssdkAffects the SDK package.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions