Skip to content

Conversation

tconley1428
Copy link
Contributor

What was changed

Instead of tracking the startActivity span across the duration of the activity, leave that up to the workflow. StartActivity is finished upon scheduling

Why?

Checklist

  1. Closes [Bug] Langfuse Tracing Not Working with Temporal OpenAI Agents Plugin #1136

  2. How was this tested:

  1. Any docs updates needed?

@tconley1428 tconley1428 requested a review from a team as a code owner October 20, 2025 20:01
Comment on lines +374 to -379
set_header_from_context(input, temporalio.workflow.payload_converter())
if trace:
with custom_span(
name="temporal:signalChildWorkflow",
data={"workflowId": input.child_workflow_id},
):
set_header_from_context(input, temporalio.workflow.payload_converter())
Copy link
Member

@cretz cretz Oct 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this code changed here and in a few places. IIRC, it was intentional that we did set_header_from_context inside the with custom_span so the header has that current span serialized (and therefore spans that occur inside workflow will have this as a parent).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was, but I think it wasn't actually correct to do. Since the signal span would more or less immediately end, I think it is misleading to parent the child workflow execution to the signal span. Rather, the child workflow is parented to the parent workflow's span (or whatever user defined span is active at that point in the workflow).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the same change I am making for startActivity essentially, the activity execution isn't parented to the startActivity, it's parented to the workflow, because really the start has already completed.

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.

[Bug] Langfuse Tracing Not Working with Temporal OpenAI Agents Plugin

3 participants