elastic / apm-agent-php

Apache License 2.0
252 stars 69 forks source link

Distributed tracing by CLI scripts #1142

Open bram123 opened 5 months ago

bram123 commented 5 months ago

Is your feature request related to a problem? Please describe. We would like to add distributed tracing to CLI scripts. We have a scheduler process that starts separate PHP processes. This scheduler reports back runtime status among other things. It would be great if we can pass the traceId + transactionId of the scheduler script, to the new PHP processes. Where it would be set as traceId + parentId.

Describe the solution you'd like The extension not only looks for request headers, but also for an ENV var. This way we can pass the tracecontext of the scheduler script to the new spawned processes.