Instrumentation library for Swift server applications

What's New



Supported Swift versions

  • This release drops the support for Swift 5.6, and keeps support for 5.7, 5.8, 5.9, 5.10.

  • The legacy type LegacyTracer remains available however is now deprecated.

  • Please avoid using the deprecated "AnySpan" based APIs.

This release also cleans up some Sendability warnings in preparation for "complete concurrency checking" that will arrive in Swift 6.

What's Changed

  • Update the adoption tables by @ktoso in #131
  • Enable strict concurrency checking in CI by @czechboy0 in #132
  • Add Span.updateAttributes by @adam-fowler in #133
  • Update README with the status of Swift-OTel by @Joannis in #135
  • Remove old benchmark infra and replace with package-benchmark by @ktoso in #140
  • [PATCH] [bug] Fix ignored at argument in two instances of withSpan by @ktoso in #139
  • Add CI for Swift 5.10 by @yim-lee in #138
  • Bump minimum Swift version to 5.7 by @rnro in #134
  • Sendable Instrument Carriers by @slashmo in #136

New Contributors

Full Changelog: 1.0.1...1.1.0

Swift Distributed Tracing

A Distributed Tracing API for Swift.

This is a collection of Swift libraries enabling the instrumentation of server side applications using tools such as tracers. Our goal is to provide a common foundation that allows to freely choose how to instrument systems with minimal changes to your actual code.

While Swift Distributed Tracing allows building all kinds of instruments, which can co-exist in applications transparently, its primary use is instrumenting multi-threaded and distributed systems with Distributed Traces.

This project uses the context propagation type defined independently in:


This project is designed in a very open and extensible manner, such that various instrumentation and tracing systems can be built on top of it.

The purpose of the tracing package is to serve as common API for all tracer and instrumentation implementations. Thanks to this, libraries may only need to be instrumented once, and then be used with any tracer which conforms to this API.

Tracing Backends

Compatible Tracer implementations:

Library Status Description
@slashmo / Swift OTel 🟢 Updated for 1.0 Exports spans to OpenTelemetry Collector; Compatible with Zipkin, X-Ray Jaeger, and more.
@pokrywka / AWS xRay SDK Swift 🟠 Not updated for 1.0 ...
Your library? ... Get in touch!

If you know of any other library please send in a pull request to add it to the list, thank you!

Libraries & Frameworks

As this API package was just released, no projects have yet fully adopted it, the following table for not serves as reference to prior work in adopting tracing work. As projects move to adopt tracing completely, the table will be used to track adoption phases of the various libraries.

HTTP Servers/Frameworks Integrates Status
Hummingbird Tracing 🟢 Built-in support
Vapor Tracing Support planned
Your library? ... Get in touch!
Client libraries
AsyncHTTPClient Tracing 🟠 Pending
Swift gRPC Tracing 🟠 Pending
Swift Distributed Cluster Tracing 🟠 Pending
Your library? ... Get in touch!

If you know of any other library please send in a pull request to add it to the list, thank you!

Reference Documentation

Please refer to the reference documentation for detailed guides about adopting distributed tracing in your applications, libraries and frameworks.


Please make sure to run the ./scripts/soundness.sh script when contributing, it checks formatting and similar things.

You can ensure it always is run and passes before you push by installing a pre-push hook with git:

echo './scripts/soundness.sh' > .git/hooks/pre-push


We use a specific version of nicklockwood/swiftformat. Please take a look at our Dockerfile to see which version is currently being used and install it on your machine before running the script.


  • Swift Tools 5.7.0
View More Packages from this Author


Last updated: Thu Apr 18 2024 13:44:27 GMT-0900 (Hawaii-Aleutian Daylight Time)