eventual icon indicating copy to clipboard operation
eventual copied to clipboard

Feature: Consuming Child Workflow Logs with Parent Workflow

Open thantos opened this issue 2 years ago • 1 comments

From #209

An issue to discuss the relationship between a child workflow and it's parent and how the logs should be stored/consumed.

  • Should the cli always return child logs for the parent workflow? And all ancestors/descendents?
  • Would you want to consume just the log of the child?
  • Could a child be too chatty to merge with the parent?
  • When id a child workflow just a workflow being used (utility) vs a semantic child?

thantos avatar Jan 11 '23 20:01 thantos

From the beta chat

@sam-goodwin

@Beta Testers - we are designing how we will manage logs for eventual. We are creating a LogStream for each workflow execution and putting all the related workflow and activity logs for that execution in there. We are trying to figure out what to do with child workflows (workflows started by another workflow).

Should the child’s (and its activities) logs go in the parent’s log stream or its own?

@yehudacohen

Maybe use a logstream prefix that get's longer: /parent-execution-id/child-execution-id/grandchild-execution-id but separate log streams That way you can query by log stream prefix to get both views

@sam-goodwin

We'd have to keep them finite to avoid hitting a limit on name size. But that would be a really nice capability! Perhaps the CLI can help here? We could at least always include the root workflow execution's ID in child execution IDs so that you can query by the root workflow execution's ID as a prefix in Logs. The limit is 512 so we'd hit that quickly but maybe for most use-cases it would be fine - so we could just truncate after hitting the limit?

@yehudacohen

Yeah, I think you'd have to truncate at some point, but this should provide some value. You might also, truncate the nested workflow IDs to allow deeper nesting. This assumes a randomly generated uniformly distributed workflow id where each character is random. In this case, you can make assumptions that the probability of two child workflow ids colliding in a single workflow is so rare that you can just truncate the first 6 or so characters and use those

@thantos

When you are viewing the logs for the parent workflow, would you always want to see the child logs intermingled? For example get logs --workflow parentWorkflow - should this return the logs for all children at any depth too?

@yehudacohen

I think optionally add a depth flag that let's you see child workflow logs but by default not

thantos avatar Jan 11 '23 20:01 thantos