Skip to content

Make child workflows create OpenTelemetry child spans #317

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dbos/_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def create_child(self) -> DBOSContext:
)
rv.request = self.request
rv.assumed_role = self.assumed_role
rv.spans = list(self.spans)
return rv

def has_parent(self) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion dbos/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ def _get_new_wf() -> tuple[str, DBOSContext]:
# Pass the new context to a worker thread that will run the wf function
cur_ctx = get_local_dbos_context()
if cur_ctx is not None and cur_ctx.is_within_workflow():
assert cur_ctx.is_workflow() # Not in a step
assert cur_ctx.is_workflow(), "Not in a step" # Not in a step
cur_ctx.function_id += 1
if len(cur_ctx.id_assigned_for_next_workflow) == 0:
cur_ctx.id_assigned_for_next_workflow = (
Expand Down