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

Method for injecting trace parent into curl #306

Closed
jeeftor opened this issue Feb 20, 2024 · 3 comments
Closed

Method for injecting trace parent into curl #306

jeeftor opened this issue Feb 20, 2024 · 3 comments

Comments

@jeeftor
Copy link

jeeftor commented Feb 20, 2024

I wrote my own cli client for Otel and then found this one ... is there a way to inject the trace parent from an exec into the curl headers so I can see the full round trip of my existing tracing with this command?

@tobert
Copy link
Collaborator

tobert commented Feb 23, 2024

There's not an easy way to do it right now. I had an old issue for this that I'll work on now that I have a request for it.

The way I've done it so far is with a TRACEPARENT environment variable.

traceparent_file=$(mktemp)
otel-cli span --name "first span in the trace" --tp-carrier $traceparent_file --tp-export --endpoint https://collector
. $traceparent_file
otel-cli exec --endpoint https://collector -- curl -X "traceparent: $TRACEPARENT" https://site.com/file

@jeeftor
Copy link
Author

jeeftor commented Feb 23, 2024

Ended up just writing my own client

@tobert
Copy link
Collaborator

tobert commented Mar 11, 2024

Released 0.4.3 with the injection feature. Sorry the timing didn't work out @jeeftor, and thanks for the bump to get this feature in.

@tobert tobert closed this as completed Mar 11, 2024
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

2 participants