The Sync Instruments created through Meter API are not used internally within SDK. So it would be good to return nostd::unique_ptr for them. Changes are required in API and SDK for
- Counter ( UINT64 and Double)
- Histogram ( UINT64 and Double)
- UpDownCounter ( INT64 and Double)
The Async Instruments can continue to return nostd::shared_ptr.
As part of this or separate PR, we can also maintain the shared_ptr of Async Instrument (instead of current raw pointer) in Observable Registry
|
opentelemetry::metrics::ObservableInstrument *instrument; |
The Sync Instruments created through Meter API are not used internally within SDK. So it would be good to return nostd::unique_ptr for them. Changes are required in API and SDK for
The Async Instruments can continue to return
nostd::shared_ptr.As part of this or separate PR, we can also maintain the shared_ptr of Async Instrument (instead of current raw pointer) in Observable Registry
opentelemetry-cpp/sdk/include/opentelemetry/sdk/metrics/state/observable_registry.h
Line 24 in ac105bf