v1.0.0-beta.8
Pre-release
Pre-release
·
39 commits
to main
since this release
Added
OTelFactory.isAPIFactory— identifies the API's auto-installed no-op
factory. Defaults tofalseonOTelFactory;OTelAPIFactoryoverrides it
totrue. SDK factories (which extendOTelAPIFactory) must override it to
returnfalse. Lets SDK initialization replace the spec-mandated no-op API
factory installed when API code runs first, instead of relying on
runtimeTypechecks (see dartastic_opentelemetry #50 / PR #53).
Fixed
Context.root/Context.current(and other Context APIs) threw
StateError('Call initialize() first.')when accessed before
OTelAPI.initialize(), violating the OTel spec requirement that the API
operate as a no-op without an SDK installed. They now lazily install the
No-Op API factory, matchingOTelAPI's existing behavior. Thanks
@benjaben.Contextre-reads the global factory on every access instead of keeping
the first one it saw, so a factory installed later (e.g. by an SDK's
initialize()) replaces a no-op cached before initialization.OTelAPI.initialize()now replaces an installed no-op API factory
(isAPIFactory == true) instead of throwing, so API use before
initialization (e.g.Context.current) no longer blocks explicit
initialization. Behavior change: re-initializing over a no-op API
factory replaces it and applies the new configuration; only a real
(non-API) factory still triggers the initialize-onceStateError.