Skip to content

馃殌 Swift OTel 1.0.0

Choose a tag to compare

@slashmo slashmo released this 29 Sep 12:03
· 41 commits to main since this release
fa1ad6d

馃檹 Thanks

A special thank you to everyone who contributed to this milestone鈥攚hether you've opened issues, contributed code, or responded to proposals on the Swift forums, we couldn't have done it without you! 馃憦鉂わ笍馃

馃専 Highlights

  • OTLP backends for Swift Log, Swift Metrics, and Swift Distributed Tracing
  • Streamlined, one-line bootstrap
  • Simple, centralized configuration
  • APIs for manual bootstrap and advanced use cases
  • Conditional transitive dependencies using package traits
  • Console backend for Swift Log, for local development
  • Example projects hosted in repository
  • Documentation overhaul
  • Bug fixes and improvements

馃攳 Details

OTLP backends for Swift Log, Swift Metrics, and Swift Distributed Tracing

  • Supports OTLP/HTTP+Protobuf, OTLP/HTTP+json, and OTLP/gRPC
  • OTLP exporters support (m)TLS, retries, and custom headers
  • OTLP/gRPC exporter uses gRPC Swift v2

Streamlined, one-line bootstrap

Simple, centralized configuration

APIs for manual bootstrap and advanced use cases

Conditional transitive dependencies using package traits

  • OTLP/HTTP exporters are available only when the OTLPHTTP trait is enabled
  • OTLP/gRPC exporters are available only when the OTLPGRPC trait is enabled
  • Both OTLPHTTP and OTLPGRPC traits are enabled by default

Console backend for Swift Log, for local development

  • OTel.Configuration.logs.exporter = .console or OTEL_LOGS_EXPORTER=console

Example projects hosted in repository

Documentation overhaul

Bug fixes and improvements

  • Swift 6 language mode, with strict concurrency, and no unstructured tasks
  • Fix all compiler warnings and gate CI for warning regressions
  • Internal imports by default to avoid implementation leaks in the API
  • Use FoundationEssentials on platforms where it's available
  • Include min and max in OTLP histogram export
  • Drop spans/logs when batch processor buffer is full and emit warning
  • Graceful shutdown improvements, using Service Lifecycle for nested internal components
  • Improve performance of OTLP exporters by avoiding a conversion to Data
  • Improve performance of withSpan, especially when spans are dropped
  • Diagnostic logging decoupled from bootstrapped backend and emitted to console
  • Diagnostic logging uses more consistent levels and content
  • Diagnostic logging includes hint when boostrapping logging backend about console exporter