Skip to content

feature(datashare-python): w3c trace context#31

Merged
ClemDoum merged 3 commits intomainfrom
feature(datashare-python)/w3c-trace-context
Apr 23, 2026
Merged

feature(datashare-python): w3c trace context#31
ClemDoum merged 3 commits intomainfrom
feature(datashare-python)/w3c-trace-context

Conversation

@ClemDoum
Copy link
Copy Markdown
Contributor

@ClemDoum ClemDoum commented Apr 22, 2026

Description

Add support for W3C trace context for temporal workflows and activities.
traceparent header 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 WorkerFilter logging filter so that it can be used to log with trace context information.

Implementation was made leveraging the elegant temporal workflow Interceptor mechanism.

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-python

Added

  • added a interceptor.TraceContext object to deserialize serialize tracecontext info stored in headers's traceparent
  • added a TraceContextInterceptor interceptor which reads incoming traceparent information 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...
  • added trace content information to the WorkerFilter so that it's displayed in logs

@ClemDoum ClemDoum force-pushed the feature(datashare-python)/w3c-trace-context branch 2 times, most recently from 543fd28 to f87f08b Compare April 22, 2026 16:18
@ClemDoum ClemDoum marked this pull request as ready for review April 22, 2026 16:29
@ClemDoum ClemDoum self-assigned this Apr 22, 2026
@ClemDoum ClemDoum requested a review from winsomeglint April 22, 2026 16:29
@ClemDoum ClemDoum changed the title Feature(datashare python)/w3c trace context feature(datashare-python): w3c trace context Apr 22, 2026
@ClemDoum ClemDoum changed the base branch from feature(datashare-python)/logging to main April 23, 2026 07:52
@ClemDoum ClemDoum force-pushed the feature(datashare-python)/w3c-trace-context branch from f87f08b to eabb8ca Compare April 23, 2026 07:56
@ClemDoum ClemDoum merged commit 87a7d46 into main Apr 23, 2026
8 checks passed
@ClemDoum ClemDoum deleted the feature(datashare-python)/w3c-trace-context branch April 23, 2026 08:42
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

Successfully merging this pull request may close these issues.

1 participant