Add support to send trace information to the WebJobs extension#540
Merged
Add support to send trace information to the WebJobs extension#540
Conversation
bachuv
commented
Apr 10, 2025
cgillum
approved these changes
Apr 24, 2025
Member
cgillum
left a comment
There was a problem hiding this comment.
Agreed with @andystaples feedback. Otherwise, I'm good with these changes.
Merged
greenie-msft
pushed a commit
to greenie-msft/azure-functions-durable-python
that referenced
this pull request
Sep 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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