Skip to content

Conversation

sourcec0de
Copy link

@sourcec0de sourcec0de commented Sep 29, 2025

What was changed

This PR addresses an issue that causes RunWorkflow:* spans to be emitted when workflows are viewed in the UI (i.e in replay). To make the behavior consistent, startNonReplaySpan was extracted from tracingWorkflowOutboundInterceptor and simplified to check the workflow context and return a no-op span when the workflow is in replay mode. Then startNonReplaySpan is reused in all places where a workflow context is in scope.

Why?

Discern uses the RunWorkflow:* otel span to alert on complete workflow failures (i.e a workflow that has died indefinitely). When viewing the temporal UI in the cloud console, our monitoring is re-triggered because the query to the worker replays the workflow history and re-emits the RunWorkflow span.

Historical context in slack

How was this tested:

I am still in the process of testing this using go workspaces by aliasing my branch of temporalio/sdk-go in our Go environment.

@CLAassistant
Copy link

CLAassistant commented Sep 29, 2025

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@sourcec0de
Copy link
Author

cc: @cretz

@sourcec0de sourcec0de force-pushed the fix/consistent-interceptor-span-emission branch from 0a350a2 to c02b4c3 Compare September 29, 2025 15:30
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