temporalio / temporalio/features

[Bug] Incomplete Span Reporting: Only RunActivity Spans Sent When Workflow Triggered via scheduler

Open
#422 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Go
Stars
32
Forks
28
Avg merge
1d 9h
Merged PRs (30d)
7

Description

What are you really trying to do?

I'm aiming to establish comprehensive tracing observability for temporal workflows initiated via scheduling.

Describe the bug

When the worfklow is triggered using create_schedule, only RunActivity spans are captured. However when it is triggered manually using start_workflow or execute_workflow, all spans are captured.

Tracing capture using jaeger for both manual and scheduled workflow executions. It shows workflow triggered manually with 5 spans, and the workflows triggered using schedule with 1 span.
Screenshot 2024-02-22 at 10 20 45

The screenshot below show that the only span capture for the scheduled workflows is RunActivity
Screenshot 2024-02-22 at 10 19 02

However for the workflows triggered manually using starter.py, we can see 5 spans captured. It is seen 5 spans: StartWorkflow, RunWorkflow, StartActivity, RunActivity and CompleteWorkflow
Screenshot 2024-02-22 at 10 18 54

Minimal Reproduction
  1. Clone project https://github.com/temporalio/samples-python/tree/main/open_telemetry
  2. Run starter.py (execute workflow at demand)
  3. Run scheduler.py (execute workflow by scheduler) zip file attached to this issue
  4. Observe the difference of captured spans. The spans generated by the workflow triggered manually is 5, while for the workflow triggered using create_schedule is 1. It should be the same for both.
Environment/Versions
  • OS and processor: M1 Mac
  • Temporal Version: Python SDK 1.5.0
  • Are you using Docker or Kubernetes or building Temporal from source? I am running docker container for jaeger
Additional context

scheduler.py.zip

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the open_telemetry sample, especially starter.py and scheduler.py, and run both workflows while comparing their Jaeger traces. Check why create_schedule produces only RunActivity while manual execution produces five spans. Done means scheduled executions report the same StartWorkflow, RunWorkflow, StartActivity, RunActivity, and CompleteWorkflow spans as manual executions.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python
Domain
observability
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.