Skip to content

Conversation

@saig214
Copy link
Contributor

@saig214 saig214 commented Dec 11, 2025

Summary

Add CorrelationContextInterceptor to propagate atlan-* fields to activities and refactor correlation handling.

Changes

  • Add CorrelationContextInterceptor to propagate atlan-* fields to activities
  • Refactor correlation string handling in AtlanLoggerAdapter
  • Extract shared ContextVars to break circular imports
  • Incorporate generic headers + refactors

Test plan

  • Unit tests for CorrelationContextInterceptor
  • Integration tests for header propagation
  • Verify correlation context flows correctly through activities

Note

Adds a Temporal interceptor to propagate atlan-* fields from workflow args to activity headers, wires it into the worker, and removes ad-hoc correlation handling with unit tests.

  • Interceptors:
    • Correlation context: Add CorrelationContextInterceptor with workflow inbound/outbound and activity inbound interceptors to extract atlan-* from workflow args and inject/read them via Temporal headers (application_sdk/interceptors/correlation_context.py).
  • Worker wiring:
    • Register CorrelationContextInterceptor() in worker interceptors (application_sdk/clients/temporal.py).
  • Refactor/cleanup:
    • Remove ad-hoc correlation context setting from EventActivityInboundInterceptor and WorkflowInterface.run (application_sdk/interceptors/events.py, application_sdk/workflows/__init__.py).
  • Tests:
    • Add comprehensive unit tests for correlation propagation and constants (tests/unit/interceptors/test_correlation_context.py).

Written by Cursor Bugbot for commit 743641f. This will update automatically on new commits. Configure here.

…o activities

Adds a new Temporal interceptor that propagates atlan-* correlation context
fields (like atlan-ignore, atlan-argo-workflow-id, atlan-argo-workflow-node)
from workflow arguments to all activities via Temporal headers.

This ensures all activity logs include correlation identifiers, fixing the
issue where activities like cleanup and publish_event were missing these fields.

Changes:
- Add CorrelationContextInterceptor with workflow inbound/outbound and activity
  inbound interceptors
- Register as first interceptor in temporal.py
- Remove redundant correlation context handling from events.py and workflows/__init__.py
- Add comprehensive unit tests
@saig214 saig214 merged commit a8bd523 into LH-88 Dec 11, 2025
2 checks passed
@saig214 saig214 deleted the LH-88-ContextPropagator branch December 11, 2025 15:51
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.

2 participants