Skip to content

v1.1.0-beta.14

Pre-release
Pre-release

Choose a tag to compare

@michaelbushe michaelbushe released this 23 Aug 21:52
· 9 commits to main since this release

Changed

  • 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.withSpanContext now 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 API extract must 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 deprecated spanStatus argument 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). A Drop decision produces a non-recording
    span that reaches no processor; RecordOnly records without setting the
    W3C Sampled flag; built-in processors deliver only recording spans to
    onStart/onEnd and only sampled spans to exporters, per the spec's
    IsRecording/Sampled reaction table; the forbidden Sampled+non-recording
    combination is unrepresentable; createSpan routes 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 bare AlwaysOn (#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
    SamplingResult gains a traceState field (#125) so samplers can
    modify or replace it: null keeps the inherited parent TraceState, an
    explicitly empty TraceState clears it. Existing custom samplers keep
    working unchanged.

  • BREAKING: OTelEnv configuration functions (getOtlpConfig, getBspConfig, getServiceConfig, getLogRecordLimits, etc.) now return strongly-typed Dart Records instead of Map<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-Agent header. Per the OTLP
    spec, OTLP requests SHOULD identify the exporter, language, and version.
    Every OTLP request now carries OTel-OTLP-Exporter-Dart/<version> (HTTP
    headers on the HTTP exporters; ChannelOptions.userAgent on the gRPC
    exporters). A user-supplied user-agent header 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 and user_agent.original are now
    populated on web
    (#190). Invalid @JS bindings 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.mobile is now a boolean, which is how the registry types it.
    It was emitted as the string 'true'/'false', so a backend filtering
    browser.mobile = true matched nothing.

  • browser.languages is 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 neighbouring browser.brands.
    The key is now BrowserCandidate.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.vendor is no longer emitted. navigator.vendor is a frozen
    legacy API that returns a hardcoded vendor string rather than the real
    vendor, and the registry's browser.brands is the structured answer to
    the same question.

  • browser.mobile is now correct on iPad. Since iPadOS 13 an iPad
    requests desktop sites by default and reports a Macintosh user agent,
    so a user-agent test alone reported every iPad as a desktop. The
    detector now also consults navigator.maxTouchPoints, which
    distinguishes a touch device from a Mac. A touchscreen laptop is still
    not mobile — both signals have to agree.

  • OtlpHttpMetricExporter.forceFlush() and shutdown() now await
    in-flight exports
    (#262). Both returned immediately, and shutdown()
    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.enabled now returns false when TracerProvider has 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 to http://localhost:4317 for OTLP/gRPC and
    http://localhost:4318 for 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.getValue now normalizes
    empty strings to null, 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.name in OTEL_RESOURCE_ATTRIBUTES no longer overrides an
    explicit serviceName: argument or OTEL_SERVICE_NAME
    (#103).
    Precedence is now, highest first: explicit argument, OTEL_SERVICE_NAME,
    OTEL_RESOURCE_ATTRIBUTES, default. service.version follows the same
    order.

  • OTEL_LOG_LEVEL now takes effect at the start of OTel.initialize, so
    debug logging covers the environment parsing itself.

  • Baggage values containing = (e.g. base64 padding) are no longer
    dropped
    on extract, and an unparsable baggage header leaves existing
    baggage untouched instead of clearing it. Thanks to @abidiahmedcom
    (#199, #200, #261).