Skip to content

[Feature] Propagate trace to subprocesses via ExecIntegration #4031

Description

@jchamberlain

Describe the feature you'd like

When a sub process is started via proc_open() (e.g., using Symfony's Process), environment variables must be set manually to propagate distributed tracing. Having done that, the sub process's span becomes a sibling of the sh span created by ddtrace's exec integration, but ideally it would be a child of sh.

The exec integration was updated in #3838 to propagate session ID, and the same approach could be taken to propagate the trace and parent IDs. This would solve both problems: no more manually adding env vars, and the new process could be a child of the sh span instead of a sibling.

Is your feature request related to a problem?

No response

Describe alternatives you've considered

I currently have my own hook added to proc_open() which successfully propagates the trace, but it can't access the span created in ExecIntegration.php, so I can't make the subprocess a child of sh.

Additional context

No response

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