Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Linux support via a TaskLocalContextManager #546

Merged
merged 31 commits into from
Jul 23, 2024

Conversation

semicoleon
Copy link
Contributor

This is another attempt at adding Linux support (and closing #38) after #438 turned out to be unworkable for merging.

I have attempted to avoid changes to the core library as much as possible, instead using an additional library OpenTelemetryConcurrency (better name suggestions are welcome) which uses some wrapper types, and the split out SpanBuilderBase and SpanBase protocols to discourage use of old style APIs like setActive and end(time:) which don't behave as expected when using TaskLocal's to carry context around for users who have elected to use the wrapper library.

Spliting SpanBuilder and Span into two protocols each is the most invasive change in this PR. I chose to do it that way to avoid having to maintain all of the SpanBuilderBase and SpanBase methods on a wrapper type, but if that split would be a semver hazard (or just not desirable to the team) I can switch to using a wrapper type for those like I did for TracerProvider and Tracer.

Using a wrapper library does require exposing some API's outside of OpenTelemetryApi. I elected to use the package keyword rather than make the public, but that means OpenTelemetryConcurrency can't be used on versions of swift < 5.9. This is also something that could be adjusted if that's not desirable.

@bryce-b
Copy link
Member

bryce-b commented Jun 12, 2024

can you add a GH action that runs the build & tests on linux?

@semicoleon
Copy link
Contributor Author

@bryce-b I believe this is ready again. I had to debug a bizarre issue that was appearing in the Linux job, but it seems to be resolved now

@bryce-b bryce-b merged commit 408af2d into open-telemetry:main Jul 23, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants