-
Notifications
You must be signed in to change notification settings - Fork 63
Add support to send trace information to the WebJobs extension #540
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
Conversation
andystaples
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments
cgillum
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed with @andystaples feedback. Otherwise, I'm good with these changes.
andystaples
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
This PR introduces support for propagating trace information to the WebJobs extension by getting the
traceparentandtracestateinformation in thestart_newmethod by accessing the "current span" information.traceparentandtracestateare then forwarded to thepost_async_requestmethod, which now acceptstrace_parentandtrace_stateparameters in http_utils.py to include them in the outgoing request.trace_parentandtrace_stateparameters are now set as the headers in the POST request to the WebJobs extension.In the example below, I used the HTTP trigger's
traceparentandtracestateas the parent context of a new span that I created. I then set that new span as the current span before callingstart_new().Note: I followed the Azure Function OpenTelemetry set up in this example which is also emitting spans for storage requests and that's why there are spans for storage operations.
requirements.txt
Client Function code