feature(datashare-python): w3c trace context#31
Merged
Conversation
543fd28 to
f87f08b
Compare
…er interceptor to handle trace context
…e_worker` utility function
f87f08b to
eabb8ca
Compare
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.
Description
Add support for W3C trace context for temporal workflows and activities.
traceparentheader is received and read by the workflow worker.The workflow worker will then create new content span each time a new activity/workflow is executued propagating relevant content information.
The propagated information was added to the
WorkerFilterlogging filter so that it can be used to log with trace context information.Implementation was made leveraging the elegant temporal workflow
Interceptormechanism.Note: temporal does have OpenTelemetry builtin intercepter but it one pulls the whole open telemetry stack.
For now enhencing the current logging mechanism + using a single context var was enough.
Changes
datashare-pythonAdded
interceptor.TraceContextobject to deserialize serialize tracecontext info stored in headers'straceparentTraceContextInterceptorinterceptor which reads incomingtraceparentinformation provided when a workflow worker received a task. From that point a new context span will be created and propagated to all child subworflow execution, activity execution, query update, signal...WorkerFilterso that it's displayed in logs