Repository navigation
馃殌 Swift OTel 1.0.0
馃檹 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
OTel.bootstrap(configuration:)- Opaque return type to abstract internal components
Simple, centralized configuration
OTel.Configuration- Supports environment variable overrides
APIs for manual bootstrap and advanced use cases
OTel.makeLoggingBackend(configuration:)OTel.makeMetricsBackend(configuration:)OTel.makeTracingBackend(configuration:)OTel.makeLoggingMetadataProvider(configuration:)
Conditional transitive dependencies using package traits
- OTLP/HTTP exporters are available only when the
OTLPHTTPtrait is enabled - OTLP/gRPC exporters are available only when the
OTLPGRPCtrait is enabled - Both
OTLPHTTPandOTLPGRPCtraits are enabled by default
Console backend for Swift Log, for local development
OTel.Configuration.logs.exporter = .consoleorOTEL_LOGS_EXPORTER=console
Example projects hosted in repository
- Getting started
- Advanced configuration
- Integrations
Documentation overhaul
- Public API DocC coverage
- Docs hosted on Swift Package Index
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
FoundationEssentialson 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