v1.1.0-beta.14
Pre-releaseChanged
-
Requires
dartastic_opentelemetry_api^1.0.0-rc.2. Picks up the
semantic conventions at registry v1.44.0 — including the full
browser.web_vital.*set — and three spec-compliance fixes.One of those changes behaviour visible from this package:
Context.withSpanContextnow returns a derived Context when the incoming
span context belongs to a different trace, instead of throwing
ArgumentError. Per the Context specification a set-value operation always
returns a derived Context, and per the Propagators APIextractmust never
throw — receiving a valid span context for another trace during extraction
is ordinary, not an error. Four tests that asserted the throw now assert the
derived Context.SDKSpan.end()no longer forwards the deprecatedspanStatusargument to
its delegate;setStatus()had already applied it to the same delegate, so
the second pass was redundant. -
BREAKING (spec compliance): sampler decisions are now honored end to end
(#120, #121, #122, #123, #129). ADropdecision produces a non-recording
span that reaches no processor;RecordOnlyrecords without setting the
W3CSampledflag; built-in processors deliver only recording spans to
onStart/onEndand only sampled spans to exporters, per the spec's
IsRecording/Sampled reaction table; the forbidden Sampled+non-recording
combination is unrepresentable;createSpanroutes through the sampler and
processors instead of bypassing them. Code that relied on unsampled or
dropped spans being exported must adjust its sampler configuration. -
BREAKING (spec compliance): the default sampler is now
ParentBased(root: AlwaysOn)instead of bareAlwaysOn(#126). Root
spans still sample by default, but child spans of unsampled remote or local
parents now respect the parent's decision. Pass
sampler: const AlwaysOnSampler()to restore the old behavior. -
Child spans inherit the parent
TraceState(#124), and
SamplingResultgains atraceStatefield (#125) so samplers can
modify or replace it:nullkeeps the inherited parent TraceState, an
explicitly emptyTraceStateclears it. Existing custom samplers keep
working unchanged. -
BREAKING:
OTelEnvconfiguration functions (getOtlpConfig,getBspConfig,getServiceConfig,getLogRecordLimits, etc.) now return strongly-typed Dart Records instead ofMap<String, dynamic>.
Migration hint: Update map accesses to record property accesses (e.g.,config['endpoint'] as String?→config.endpoint).
Added
-
TracerProvider.hasSpanProcessors— allocation-free check for registered
span processors. -
OTLP exporters send an identifying
User-Agentheader. Per the OTLP
spec, OTLP requests SHOULD identify the exporter, language, and version.
Every OTLP request now carriesOTel-OTLP-Exporter-Dart/<version>(HTTP
headers on the HTTP exporters;ChannelOptions.userAgenton the gRPC
exporters). A user-supplieduser-agentheader is prepended to the default
rather than replacing it (#228). -
OTel.defaultGrpcEndpoint(http://localhost:4317), the OTLP/gRPC
default endpoint. The endpoint default is now picked per signal after the
protocol is resolved instead of defaulting everything to the HTTP port
4318 (#220).
Fixed
-
browser.*resource attributes anduser_agent.originalare now
populated on web (#190). Invalid@JSbindings made the web resource
detector throw on first use; the error was swallowed and the attributes
were silently missing. A detector failure now omits attributes instead of
emitting blanks. -
browser.mobileis now a boolean, which is how the registry types it.
It was emitted as the string'true'/'false', so a backend filtering
browser.mobile = truematched nothing. -
browser.languagesis now a string array, and its key comes from the
API. It was a comma-joined string under a key this package declared
privately. The naming rules say an attribute that can represent multiple
entities "SHOULD be pluralized and the value type SHOULD be an array",
which is also how the registry shapes the neighbouringbrowser.brands.
The key is nowBrowserCandidate.browserLanguages, staged in the API as an
upstream candidate, so the name and the argument for it live in one place.
It is set only when the browser reports languages: an empty array is a real
value on the wire and would claim the browser accepts none. -
browser.vendoris no longer emitted.navigator.vendoris a frozen
legacy API that returns a hardcoded vendor string rather than the real
vendor, and the registry'sbrowser.brandsis the structured answer to
the same question. -
browser.mobileis now correct on iPad. Since iPadOS 13 an iPad
requests desktop sites by default and reports aMacintoshuser agent,
so a user-agent test alone reported every iPad as a desktop. The
detector now also consultsnavigator.maxTouchPoints, which
distinguishes a touch device from a Mac. A touchscreen laptop is still
not mobile — both signals have to agree. -
OtlpHttpMetricExporter.forceFlush()andshutdown()now await
in-flight exports (#262). Both returned immediately, andshutdown()
closed the HTTP client under the live request — failing an export that
was about to succeed. Now matches the span and log HTTP exporters. -
Tracer.enablednow returnsfalsewhenTracerProviderhas no span
processor(s) registered, per the Trace SDK spec, sparing span-creation cost
when nothing is listening. Thanks to @abidiahmedcom (#138, #175). -
OTLP/gRPC exporters now default to port 4317, not 4318. The OTLP spec
defaults the endpoint tohttp://localhost:4317for OTLP/gRPC and
http://localhost:4318for the two HTTP protocols. Previously a single
4318 default was applied before the protocol was known, so gRPC-only
deployments silently exported to the wrong port (#220). -
An empty environment variable value is treated as unset. Per the spec,
an empty value of an environment variable MUST be interpreted the same way
as when the variable is unset.EnvironmentService.getValuenow normalizes
empty strings tonull, so every consumer (endpoint, protocol, service
name, log level, …) reads an empty value as unset (#213).Thanks to @abidiahmedcom; reported by @yuzurihaaa (#213, #220, #228).
-
service.nameinOTEL_RESOURCE_ATTRIBUTESno longer overrides an
explicitserviceName:argument orOTEL_SERVICE_NAME(#103).
Precedence is now, highest first: explicit argument,OTEL_SERVICE_NAME,
OTEL_RESOURCE_ATTRIBUTES, default.service.versionfollows the same
order. -
OTEL_LOG_LEVELnow takes effect at the start ofOTel.initialize, so
debug logging covers the environment parsing itself. -
Baggage values containing
=(e.g. base64 padding) are no longer
dropped on extract, and an unparsablebaggageheader leaves existing
baggage untouched instead of clearing it. Thanks to @abidiahmedcom
(#199, #200, #261).