-
Notifications
You must be signed in to change notification settings - Fork 59
Description
A common use case for otel-cli exec is to wrap curl. When a traceparent is already in the environment, it's pretty straightforward: otel-cli exec curl -H "traceparent: ${TRACEPARENT}" $url
. Even when that's present sometimes we want a separate span around the exec, and currently doing that is clunky / hard.
If we add templating for command arguments passing through otel-cli exec it could be come straightforward to do:
otel-cli exec curl -H "traceparent: {{traceparent}}"
Where, otel-cli exec would start the span then inject that traceparent into the curl command's header, and then things should all line up nicely.
This code should be careful to only pass a traceparent it generated to avoid any security issues around command injection. It's not a terribly likely path of attack but worth keeping in mind when dealing with command manipulation.