Giter Site home page Giter Site logo

apple / swift-distributed-tracing-baggage Goto Github PK

View Code? Open in Web Editor NEW
54.0 26.0 16.0 155 KB

Minimal type-safe context propagation container

Home Page: https://github.com/apple/swift-distributed-tracing

License: Apache License 2.0

Swift 65.08% Ruby 14.74% Shell 18.09% Dockerfile 2.09%
context-propagation distributed-systems concurrency async-context baggage baggage-context trace-context sswg

swift-distributed-tracing-baggage's Issues

Access control per baggage item key

This mirrors the slashmo/gsoc-swift-baggage-context#35 ticket

--

Additional capability similar to privacy in os_log to be added to baggage keys.

A key has to define if it wants to be included in forEach and if it wants to be logged.

[...] mark a key as containing sensitive information . for example, you may have a key that carries sensitive user information and that you never want the collectors to log

via @tomerd

`Baggage.$current.withValue` vs `Baggage.withValue` and actors

If I call either Baggage.$current.withValue or Baggage.withValue from an actor where the closure accesses the same actor I get different results. The first compiles fine and the second errors with the following

non-sendable type '() async throws -> ()' exiting actor-isolated context in call to non-isolated static method 'withValue(_:operation:)' cannot cross actor boundary

Compilation fails on Swift 5.5 [known issue until Xcode ships with macOS 12 SDK]

Environment:

swift --version
swift-driver version: 1.26.9 Apple Swift version 5.5 (swiftlang-1300.0.31.1 clang-1300.0.29.1)
Target: x86_64-apple-macosx11.0

Steps:

swift build

Result:

/xxx/swift-distributed-tracing-baggage/Sources/InstrumentationBaggage/Baggage.swift:232:5: error: unknown attribute 'TaskLocal'
    @TaskLocal public static var current: Baggage?
    ^
[2/2] Compiling InstrumentationBaggage BaggageKey.swift

Expected result:

Additional steps/requirements like extra compilation flags described in README.md and, if possible, included in the manifest file Package.swift.

Remove LoggingContext and BaggageCore

In the future, Logging should be handled elsewhere.

Remove BaggageCore

The reason for splitting up Baggage into two repositories, Baggage and BaggageCore was to have one "pure" library without the Logging dependency which others could depend on. Because the Logging dependency will be dropped from this repo, we can also get rid of baggage-core altogether and instead put its source files into this repo.

Baggage namespace has conflict with `CoreBaggage.Baggage`

This package produces a library called Baggage.

The library Baggage uses @_exported import CoreBaggage.
CoreBaggage has a struct Baggage.

For this reason it is not possible to use the Baggage namespace. The compiler will always detect Baggage as the struct form CoreBaggage.

Failing code:

import Baggage

extension Lambda.Context: Baggage.LoggingContext {}

Produces the compile error: 'LoggingContext' is not a member of struct 'CoreBaggage.Baggage'.

requiring Sendable from Baggage is source breaking

This commit required that types confirming to BaggageKey are now Sendable on Swift 5.5+.

That change obviously makes sense but unfortunately, it's source breaking...

That's fine by SemVer (because this package is version 0.x) but probably still an issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.