Skip to content

Support propagating span, trace ids via environment variable #3313

@dshivashankar1994

Description

@dshivashankar1994

Is your feature request related to a problem?
Yes. I have a custom multi-processor which is capable of launching workers in remote hosts for processing. In such cases the python context is not propagated and only the environment variables are propagated. Because of this, the parent-child relation is not properly maintained if a function invokes another function over these remote-workers.

Describe the solution you'd like
The request is to support setting the span-id, trace-id etc., in the environment whenever span is started and propagate, process them from the environment.

Describe alternatives you've considered
Passing the span id, trace id in serialized fashion while to these workers over network is not possible as these workers are linux workers and don't have a port to communicate.

Additional context
I've prepared a small PoC for my work. A pre-step is, checking the environment for any existing span-id/trace-id set. If exists, create a span out of it and store in the context and use the context while creating span. While starting span, I set the span-id, trace-id etc., in the environment.
I'm not sure of the value this brings to the table. But still wanted to bring this to discussion to see if there are any caveats in such behavior and to understand why OT never supported such env propagation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions