Swiftpack.co - apple/swift-distributed-tracing-baggage as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by apple.
apple/swift-distributed-tracing-baggage 0.4.1
Minimal context propagation container with Logging
⭐️ 25
🕓 12 weeks ago
.package(url: "https://github.com/apple/swift-distributed-tracing-baggage.git", from: "0.4.1")

🧳 Distributed Tracing: Baggage

Swift 5.1 Swift 5.2 Swift 5.3 Swift 5.4 Swift 5.5 Swift 5.6 Swift 5.7

Warning Automatic propagation through task-locals only supported in Swift >= 5.5

Baggage is a minimal (zero-dependency) context propagation container, intended to "carry" baggage items for purposes of cross-cutting tools to be built on top of it.

It is modeled after the concepts explained in W3C Baggage and the in the spirit of Tracing Plane 's "Baggage Context" type, although by itself it does not define a specific serialization format.

See https://github.com/apple/swift-distributed-tracing for actual instrument types and implementations which can be used to deploy various cross-cutting instruments all reusing the same baggage type. More information can be found in the SSWG meeting notes.

Dependency

In order to depend on this library you can use the Swift Package Manager, and add the following dependency to your Package.swift:

dependencies: [
  .package(
    url: "https://github.com/apple/swift-distributed-tracing-baggage.git",
    from: "0.2.0"
  )
]

and depend on the module in your target:

targets: [
    .target(
        name: "MyAwesomeApp",
        dependencies: [
            .product(
              name: "InstrumentationBaggage",
              package: "swift-distributed-tracing-baggage"
            ),
        ]
    ),
    // ...
]

Documentation

Please refer to in-depth discussion and documentation in the Swift Distributed Tracing repository.

Contributing

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

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

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

GitHub

link
Stars: 25
Last commit: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics