Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

Context propagation using thread local storage #97

Open
maniaabdi opened this issue Sep 3, 2018 · 4 comments
Open

Context propagation using thread local storage #97

maniaabdi opened this issue Sep 3, 2018 · 4 comments

Comments

@maniaabdi
Copy link

Hello everyone

In OpenTracing tutorial for Java the Scope operator and startActive function is used to propagate trace context using thread local storage.
Is there any equivalent function in cpp-client?

Regards
Mania

@billowqiu
Copy link

+1

@billowqiu
Copy link

@eyjohn
Copy link

eyjohn commented Dec 25, 2019

Very much interested in seeing this feature, I've been using a tracing library at my workplace which was loosely based on OpenTracing and had this feature, and was surprised to see it absent in OpenTracing itself. It provides the easiest way to enable existing libraries to add tracing/carrier support without having to change their public APIs.

@eyjohn
Copy link

eyjohn commented Dec 25, 2019

I'd like to try and tackle this using the ScopeManager approach in the Java version:
https://github.com/opentracing/opentracing-java/blob/master/opentracing-api/src/main/java/io/opentracing/ScopeManager.java

This requires mutable access to the span.

Since this is not explicitly a requirement of the Tracer but more like a utility, I'm thinking of keeping this outside of the Tracer interface as currently done in the Java implementation, but this can easily be added later.

The ScopeManager will guarantee thread local semantics and therefore not have any thread safety concerns.

I'll create a WIP PR shortly with a suggested interface prior to any implementation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants