-
Notifications
You must be signed in to change notification settings - Fork 57
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
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
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.
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
traceparent
andtracestate
information in thestart_new
method by accessing the "current span" information.traceparent
andtracestate
are then forwarded to thepost_async_request
method, which now acceptstrace_parent
andtrace_state
parameters in http_utils.py to include them in the outgoing request.trace_parent
andtrace_state
parameters are now set as the headers in the POST request to the WebJobs extension.In the example below, I used the HTTP trigger's
traceparent
andtracestate
as 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.