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

Implement the context propagation using environment variables #14

Open
ethercrow opened this issue Apr 26, 2020 · 2 comments
Open

Implement the context propagation using environment variables #14

ethercrow opened this issue Apr 26, 2020 · 2 comments

Comments

@ethercrow
Copy link
Owner

When a service A calls service B, it's common practice to put the trace and span ids into HTTP headers so that in the visualizer you can see spans of B as children of spans of A.

The idea is to do the similar thing when a program A calls program B as a subprocess. For example, stack or ghcide calls ghc and sets an environment variable "OPENTELEMETRY_CONTEXT=ot--". The callee would inspect the environment variables on startup and be aware of the trace id and parent span id. After we upload both eventlogs, we'll see spans of both programs participating in the same trace.

@yaitskov
Copy link

@ethercrow ,
Note.
I haven't found where OPENTELEMETRY_CONTEXT is used in stack/ghcide, but
in python project they read from that var 1 of 2 constants, not strings like "ot-fffa23432-bedc38383"
https://opentelemetry-python.readthedocs.io/en/stable/_modules/opentelemetry/context.html

@yaitskov
Copy link

@ethercrow ,

I think the following hypothetical GHC feature would solve all problems related to this ticket

https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3382

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

No branches or pull requests

2 participants