Skip to content

Releases: apple/swift-distributed-tracing

1.0.0-beta.2

21 Apr 07:42
1.0.0-beta.2
3d152af
Compare
Choose a tag to compare

Important notes

Please note that during the beta convergence period slight API changes are still happening.

Please have a look at some of the type renames and move away from Clock types towards a TracerInstant and adjust tracer implementations accordingly.

Important PRs changing APIs are:

  • Introduce top level withSpan; reclaim Tracer and Instrument for protocols by @ktoso in #113
  • remove clock protocol, use autoclosure "now" instant by @ktoso in #120
  • end() should take an autoclosure instant, not direct instant by @ktoso in #122
  • consider TracerSpan assoc type -> Span by @ktoso in #111

In addition to that you can view the 13 closed issues on the associated milestone.

Other changes

New Contributors

Full Changelog: 1.0.0-beta.1...1.0.0-beta.2

1.0.0-beta.1

29 Mar 11:16
1.0.0-beta.1
a5b5160
Compare
Choose a tag to compare

First Beta release

Hi everyone, this is the first beta release of the tracing API.

We changed many things but believe we have arrived at the final API shapes of the library.

Most notably, it is possible to stick to concrete types if necessary, abstract away the notion of time, as well as mutate span names in-flight before they are ended.

No-op tracing also gained significant performance improvements, with NoopSpan becoming a struct and therefore not incurring reference counting traffic. And time is not going to be read unless the tracer decides to do so (allowing for no-op and inactive spans to avoid reading the system clock).

Call to action: please try out the APIs in your tracers or adoption

Please try out the APIs before we freeze them in a 1.0 release in the coming weeks.

During the beta period, we are still able to perform any breaking or important changes before this API will become frozen for the foreseeable future. Please raise your issues on the github issue tracker.

Updating from 0.3.x

There have been a number of source breaking changes in order to achieve the ideal 1.0 shape of APIs since the 0.3.x series of this library.

  • protocol Tracer became protocol TracerProtocol
    • this was in order to introduce the Tracer namespace so that we can offer Tracer.withSpan(...) { ... } rather than the too long InstrumentationSystem.tracer.withSpan(...) {
  • the startSpan protocol requirement now accepts a function and clock parameters
    • please use the clock to obtain the timestamp of the events emitted by the tracer, rather than other time sources
    • by default the DefaultTracerClock will be used
  • a new LegacyTracerProtocol is introduced which is designed specifically to support Swift 5.6 clients
    • this protocol cannot make use of returning generic Span types, and has to erase them to any Span, which is why all APIs are phrased as startAnySpan
    • this protocol will be deprecated as soon as the library is able to require Swift 5.7, however it will not be removed in order to retain source compatibility with adopters who may have been using this API for a migration period.
    • if your library adopting (or implementing) distributed tracing CAN use Swift 5.7+, please implement the TracerProtocol directly; Implementations for the Any versions of APIs will be provided for you automatically, delegating to your startSpan implementation, so you do not need to implement any of the Legacy APIs.
  • documentation updates are incoming, including full guides for implementing and using tracers here: #69

Swift versions

We are going to stick to the AsyncHTTP, gRPC and other core server library's Swift support strategy.

This means that this package currently will support Swift: 5.6, 5.7, 5.8, and when 5.9 is released, we will drop support for 5.6.
Supporting Swift 5.6 comes with a significant burden for this project, and we want to drop it as soon as our adopters allow us to (i.e. AsyncHTTPClient and friends).

We envision this library to be depended on by these projects and therefore must adhere to their minimum supported Swift policies.

What's Changed

  • startSpan should take tracepoint location by @ktoso in #68
  • Add .spi.yml for Swift Package Index DocC support by @yim-lee in #72
  • Change 'landing' target to Tracing by @yim-lee in #74
  • notes about LoggingContext by @ktoso in #75
  • Add CI for Swift 5.8 and update nightly to Ubuntu 22.04 by @yim-lee in #76
  • Mark types Sendable by @ktoso in #83
  • Update CoC and add CONTRIBUTING file by @ktoso in #87
  • Allow for reading and mutating a span name by @ktoso in #88
  • Recording an error may carry attributes by @ktoso in #90
  • associated type Span, Tracer as short-hand, and *Protocol types by @ktoso in #93
  • Enable struct Spans with reference semantics; optimal NoopSpan by @ktoso in #94
  • remove not used docker configurations by @ktoso in #96
  • remove linux test shims by @ktoso in #97
  • Provide explicit set/get to avoid SpanAttributeConvertible wrapping by @ktoso in #95
  • Implement TracerClock and abstract away "now" by @ktoso in #98

Full Changelog: 0.3.1...1.0.0-beta.1

0.3.1

19 Aug 08:49
0.3.1
6173049
Compare
Choose a tag to compare

Changes

  • Added withSpan overload to accept a baggage from non-async code, but have the operation closure be async
  • Prepared docc setup, though not publishing yet.

What's Changed

New Contributors

Full Changelog: 0.3.0...0.3.1

0.3.0

29 Jan 02:36
0.3.0
ef8ba96
Compare
Choose a tag to compare

Release with Sendable

0.2.0

07 Oct 09:33
7a89c90
Compare
Choose a tag to compare

Updated:

  • LoggingContext-based propagation was replaced with automatic context propagation via task-locals (#52)
  • SpanStatus now conforms to Equatable (#46)
  • OpenTelemetryTracingSupport was removed (#53)

For details on the changes please refer to the 0.2.0 milestone

0.1.4

27 Jan 09:47
fce1f7c
Compare
Choose a tag to compare

Updated:

  • TracingOpenTelemetrySupport now includes all semantic span attributes defined in Otel (0.7.0) (#38)

Fixed:

  • Replaced all usage of sanity with soundness (#37)

For details on the changes please refer to the 0.1.4 milestone

0.1.3

21 Dec 14:32
73f2b52
Compare
Choose a tag to compare

Updated:

  • SpanStatus.CannonicalCode has been removed in favor of SpanStatus.Code (#31)

Fixed:

  • The context version of withSpan now delegates to the baggage version of this function (#36)
  • A "dead" link in the README file has been fixed (#35, credit to @MrCull)

For details on the changes please refer to the 0.1.3 milestone

0.1.2

15 Dec 13:11
1767451
Compare
Choose a tag to compare

Fixed:

  • When using withSpan, span.end() is now correctly called on the happy path (#33, credit to @JensAyton)

For details on the changes please refer to the 0.1.2 milestone

0.1.1

08 Dec 10:38
0.1.1
5cf275a
Compare
Choose a tag to compare

Same as 0.1.0 however fixed the dependency url in Package.swift to use https rather than git.

0.1.0

03 Dec 23:41
a53bd0f
Compare
Choose a tag to compare

Initial release.