apple / swift-distributed-tracing

Instrumentation library for Swift server applications
https://swiftpackageindex.com/apple/swift-distributed-tracing/main/documentation/tracing
Apache License 2.0
222 stars 30 forks source link

Introduce top level withSpan; reclaim Tracer and Instrument for protocols #113

Closed ktoso closed 1 year ago

ktoso commented 1 year ago

Motivation: The TracerProtocol naming was annoyingly problematic and turns out we can and should actually move the withSpan APIs as top level functions which is typical Swift practice for such "global functionality".

This way we can withSpan() {} with less noise, and also gain back the Tracer protocol name.

resolves https://github.com/apple/swift-distributed-tracing/issues/109

ktoso commented 1 year ago

I think I fixed the parameter docs, thanks @yim-lee

I'll do another huge "docs" pass over all the docs in https://github.com/apple/swift-distributed-tracing/pull/69 as well tho