Skip to content

v1.0.0-beta.6

Pre-release
Pre-release

Choose a tag to compare

@michaelbushe michaelbushe released this 11 May 17:31
· 56 commits to main since this release

Added

  • OTelAPI.attributesOf<E extends OTelSemantic>(Map<E, Object>) — a
    shorthand-friendly counterpart to attributesFromSemanticMap.
    Parameterized on a single concrete semconv enum [E], so Dart 3.10
    static dot-shorthand can drop the prefix at the call site:

    // Today and forever:
    OTelAPI.attributesOf<Http>({
      Http.requestMethod: 'GET',
      Http.responseStatusCode: 200,
    });
    
    // With Dart 3.10+ static dot-shorthand enabled:
    OTelAPI.attributesOf<Http>({
      .requestMethod: 'GET',
      .responseStatusCode: 200,
    });

    attributesFromSemanticMap stays the right call site when you need to
    mix multiple semconv enums or your own OTelSemantic-implementing
    enums in one map.

  • New top-level User enum in semantics.dart covering the OTel-spec
    user.* keys: userId, userEmail, userFullName, userName,
    userRoles, userSession. Replaces the previous UserSemantics
    enum in ui_semantics.dart.

  • New top-level Session enum in semantics.dart covering the OTel-spec
    session.* keys: sessionId, sessionPreviousId. Spec-only subset
    of the previous SessionViewSemantics.

  • Spec-derived metric-name enums in new semantic_metrics.dart.
    Covers every metric in the OTel attribute registry except the
    language-runtime namespaces (jvm.*, go.*, nodejs.*,
    cpython.*, v8js.*, kestrel.*, aspnetcore.*, signalr.*,
    openshift.*, nfs.* — Dart apps don't emit those). Generated by
    parsing the OTel model/*/metrics.yaml files, so name / instrument
    kind / unit string travel together:

    final metric = HttpMetric.serverRequestDuration;
    metric.name;        // 'http.server.request.duration'
    metric.instrument;  // SemanticInstrument.histogram
    metric.unit;        // 's'

    Enums (15): CicdMetric, ContainerMetric, DbMetric,
    DnsMetric, FaasMetric, GenAiMetric, HttpMetric, K8sMetric,
    McpMetric, MessagingMetric, OtelMetric, ProcessMetric,
    RpcMetric, SystemMetric, VcsMetric. New OTelMetric interface
    unifies them; new SemanticInstrument enum names the four OTel
    instrument kinds.

  • Spec event-name enum in new semantic_events.dart — all 16
    spec-defined event names (exception, feature_flag.evaluation,
    browser.web_vital, gen_ai.client.inference.operation.details,
    the per-protocol *.exception events for HTTP/RPC/messaging/FaaS,
    plus azure.resource.log). SemanticEvent exposes a name
    getter; OTelEvent interface for switching.

Changed

  • Breaking: Dropped the Resource suffix from semconv-enum names where
    it didn't conflict with a built-in Dart / Flutter / common-package type.
    HttpResource.requestMethod is now Http.requestMethod,
    UrlResource.urlFull is now Url.urlFull, etc. — a straight find-and-
    replace migration for ~60 enums. Migration: replace XResource
    X for every enum below.

    Kept the Resource suffix on five enums to avoid name clashes with
    common types:

    Enum Conflicts with
    ErrorResource dart:core Error
    ExceptionResource dart:core Exception
    FileResource dart:io File
    ProcessResource dart:io Process
    ServerResource package:grpc Server
    EventResource package:web Event

    All other 60+ enums dropped the suffix: Client, Cloud,
    ComputeUnit, ComputeInstance, Database, Deployment, Device,
    Environment, FeatureFlag, GenAI, General, GraphQL, Host,
    Http, Kubernetes, Messaging, Network, OperatingSystem,
    RPC, Url, Service, SourceCode, TelemetryDistro,
    TelemetrySDK, UserAgent, Version, plus all 33 new enums in this
    release (Android, Artifact, Aws, Azure, Browser, Cassandra,
    Cicd, CloudEvents, Cloudfoundry, Code, Destination, Dns,
    Elasticsearch, Enduser, Faas, Gcp, Geo, Hardware,
    Heroku, Ios, Log, Oci, Opentracing, Otel, Peer,
    Profile, Source, System, Test, Thread, Tls, Vcs,
    Webengine).

  • Breaking — file restructure. lib/src/api/semantics/resource_semantics.dart
    lib/src/api/semantics/semantics.dart (the new consolidated home
    for the OTelSemantic interface and every attribute-key enum);
    lib/src/api/semantics/resource_values.dart
    lib/src/api/semantics/semantic_values.dart. The previous standalone
    semantics.dart (interface only) is deleted; its content moved to
    the top of the renamed file. Consumers using the package barrel
    (package:dartastic_opentelemetry_api/dartastic_opentelemetry_api.dart)
    are unaffected. Direct src/api/semantics/... imports need the
    new paths.

  • Breaking — UserSemantics removed. Use the new User enum in
    semantics.dart instead. Migration: UserSemantics.userId
    User.userId, etc.

  • Breaking — SessionViewSemantics split. OTel-spec keys
    (session.id, session.previous_id) → Session in semantics.dart.
    Datadog/Dynatrace-style non-spec RUM keys (session_id underscored,
    session.start, session.duration, view.*, action.count,
    user_satisfaction_score) → new RumSessionView enum in
    ui_semantics.dart. ui_semantics.dart is now strictly the home
    for Flutter / RUM non-spec conventions.

Added

  • Typed value-set enums — a new semantic_values.dart file exposes
    enums for the 35+ OTel attributes whose spec entry defines a closed
    set of valid string values. Each value enum exposes its on-wire
    string via a .value getter and implements OTelSemanticValue for
    future polymorphic helpers. Highlights:

    • CloudProvider, CloudPlatform, FaasInvokedProvider,
      FaasTrigger
    • HostArch, OsType
    • HttpRequestMethod, HttpConnectionState
    • NetworkType, NetworkTransport, NetworkConnectionType,
      NetworkIoDirection
    • DbSystem, DbClientConnectionState, CassandraConsistencyLevel,
      AzureCosmosdbConnectionMode, AzureCosmosdbConsistencyLevel
    • MessagingSystem, MessagingOperation
    • RpcSystem, RpcMessageType, GraphqlOperationType
    • OpentracingRefType, OtelStatusCode, OtelSpanSamplingResult,
      TelemetrySdkLanguage
    • SystemCpuState, SystemMemoryState, SystemFilesystemState,
      SystemFilesystemType, SystemPagingDirection,
      SystemPagingState, SystemPagingType, SystemProcessStatus,
      DiskIoDirection, LogIostream
    • IosAppState, AndroidAppState
    • AwsEcsLaunchType
    • CicdPipelineRunState, CicdPipelineTaskType, CicdWorkerState
    • HardwareType, TlsProtocolName
    • VcsChangeState, VcsLineChangeType, VcsRefType
    • TestCaseResultStatus, TestSuiteRunStatus
    • ProfileFrameType
    • GenAiOperationName, GenAiSystem, GenAiTokenType
    • ContainerCpuState, ProcessContextSwitchType,
      ProcessPagingFaultType

    Usage:

    OTelAPI.attributesFromSemanticMap({
      Database.dbSystemName: DbSystem.postgresql.value,
      Cloud.cloudProvider:   CloudProvider.gcp.value,
      Network.networkTransport: NetworkTransport.quic.value,
    });
  • Comprehensive semconv-enum coverage of the OTel
    attribute registry.

    Every top-level registry namespace that wasn't already represented
    now has a typed enum. Consumers can keep using raw strings for
    app-specific keys, but for spec-defined attributes there is now a
    typed-enum entry, making typos at the call site a compile error.

    New enums (33):

    • AndroidResourceandroid.os.api_level, android.app.state,
      android.state
    • ArtifactResource — software-artifact / supply-chain
      (artifact.attestation.*, artifact.hash, artifact.purl,
      artifact.version, etc.)
    • AwsResource — ECS / EKS / Lambda / S3 / CloudWatch Logs /
      DynamoDB attributes (aws.ecs.*, aws.eks.cluster.arn,
      aws.lambda.invoked_arn, aws.s3.*, aws.dynamodb.*,
      aws.log.*, aws.request_id)
    • AzureResourceazure.client.id, azure.cosmosdb.*, plus the
      legacy az.namespace / az.service_request_id keys still emitted
      by some SDKs
    • BrowserResourcebrowser.brands, browser.language,
      browser.mobile, browser.platform (matches what the SDK web
      detector emits)
    • CassandraResourcecassandra.consistency.level,
      cassandra.coordinator.dc, etc.
    • CicdResource — pipeline / task / worker attributes
      (cicd.pipeline.*, cicd.worker.*, cicd.system.component)
    • CloudEventsResourcecloudevents.event_id,
      cloudevents.event_source, cloudevents.event_spec_version,
      cloudevents.event_subject, cloudevents.event_type
    • CloudfoundryResource — Cloud Foundry platform attrs
      (cloudfoundry.app.*, cloudfoundry.org.*,
      cloudfoundry.process.*, cloudfoundry.space.*,
      cloudfoundry.system.*)
    • CodeResource — source-link attrs (code.function.name,
      code.file.path, code.line.number, code.column.number,
      code.namespace, code.stacktrace)
    • DestinationResourcedestination.address,
      destination.port (mirror of ServerResource for outbound non-HTTP)
    • DnsResourcedns.question.name, dns.answers
    • ElasticsearchResourceelasticsearch.cluster.name,
      elasticsearch.node.name, elasticsearch.node.version
    • EnduserResourceenduser.id, enduser.role, enduser.scope
      (separate from user.*; enduser.* is what services set about
      the end user they're serving)
    • EventResourceevent.name (used by the logs signal)
    • FaasResource — Function-as-a-Service attrs (faas.coldstart,
      faas.invoked_*, faas.trigger, etc.)
    • GcpResourcegcp.client.service, gcp.cloud_run.job.*,
      gcp.gce.instance.*
    • GeoResourcegeo.continent.code, geo.country.iso_code,
      geo.locality.name, geo.location.lat, geo.location.lon,
      geo.postal_code, geo.region.iso_code
    • HardwareResourcehardware.id, hardware.name,
      hardware.parent, hardware.type, hardware.serial_number,
      hardware.vendor, hardware.model
    • HerokuResourceheroku.app.id, heroku.release.commit,
      heroku.release.creation_timestamp
    • IosResourceios.app.state, ios.state
    • LogResourcelog.iostream, log.file.*, log.record.original,
      log.record.uid
    • NetworkResource — added networkProtocolName
      (network.protocol.name), networkProtocolVersion
      (network.protocol.version), and networkTransport
      (network.transport) — current OTel semconv keys for the wire
      protocol an HTTP client / server is speaking over
    • OciResourceoci.manifest.digest
    • OpentracingResourceopentracing.ref_type
    • OtelResourceotel.scope.name, otel.scope.version,
      otel.status_code, otel.status_description,
      otel.span.sampling_result, plus the deprecated-but-still-emitted
      otel.library.name / otel.library.version
    • PeerResourcepeer.service
    • ProfileResourceprofile.frame.type (experimental profiling
      signal)
    • SourceResourcesource.address, source.port (mirror of
      ClientResource for inbound non-HTTP)
    • SystemResource — system-level metric attrs for CPU / memory /
      disk / network / filesystem / paging / process (used by the SDK's
      auto-collected runtime metrics)
    • TestResourcetest.case.name, test.case.result.status,
      test.suite.name, test.suite.run.status
    • ThreadResourcethread.id, thread.name
    • TlsResource — full TLS connection attribute set
      (tls.cipher, tls.protocol.*, tls.client.*, tls.server.*)
    • UserAgentResourceuser_agent.original, user_agent.name,
      user_agent.version — the OTel semconv user-agent attributes set
      by HTTP-client instrumentation (e.g. dartastic_dio_otel) on
      each outbound request
    • VcsResource — version-control attrs
      (vcs.repository.url.full, vcs.ref.head.*, vcs.change.*,
      vcs.owner.name, vcs.provider.name, etc.)
    • WebengineResourcewebengine.description, webengine.name,
      webengine.version
  • Backfilled current-spec keys on DatabaseResource — the older
    db.system / db.name / db.statement / db.operation entries
    are retained for back-compat, with the newer formalized keys added
    alongside them: dbSystemName (db.system.name), dbNamespace
    (db.namespace), dbOperationName (db.operation.name),
    dbOperationBatchSize (db.operation.batch.size), dbQueryText
    (db.query.text), dbQuerySummary (db.query.summary),
    dbResponseStatusCode (db.response.status_code),
    dbStoredProcedureName (db.stored_procedure.name),
    dbClientConnectionState (db.client.connection.state),
    dbClientConnectionPoolName (db.client.connection.pool.name),
    dbClientConnectionUsedState (db.client.connection.used.state).

  • Backfilled current-spec keys on ComputeUnitResource (which
    holds the container.* registry): containerImageTags
    (container.image.tags, the pluralized form that replaces the
    legacy container.image.tag), containerImageId
    (container.image.id), containerImageRepoDigests
    (container.image.repo_digests), containerCommand
    (container.command), containerCommandArgs
    (container.command_args), containerCommandLine
    (container.command_line), containerCsiPluginName
    (container.csi.plugin.name), containerCsiVolumeId
    (container.csi.volume.id), containerLabels
    (container.labels).