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

Automatically wrap commands in a span #116

Open
psmoot opened this issue May 12, 2023 · 1 comment
Open

Automatically wrap commands in a span #116

psmoot opened this issue May 12, 2023 · 1 comment

Comments

@psmoot
Copy link

psmoot commented May 12, 2023

It might be very handy to be able to wrap execution of a command in a span, automatically handling trace and parent IDs. We could make adding a command to a trace as easy as:
otel span <span name> find . -name *.o

This is very similar to wrapping a command in sudo or strace.

Where this gets really handy is if running a command wrapped in a span recursively wraps another command in a span. The second otel span command should automatically detect it's already in a span and set its parent span appropriately.

What I envision is otel span <name> <command> setting environment variables which get picked up by the recursive otel span commands. When an otel span <name> <command> executes and sees those variables, it knows to use the current span ID as the parent span ID and generate a new span ID.

@psmoot
Copy link
Author

psmoot commented May 12, 2023

Feel free to assign this to me. I'd like to work on this. I did a prototype as a bash script and it's pretty straightforward. Learning to use the click library is going to take more work.

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

1 participant