-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add workflow trace #520
Add workflow trace #520
Conversation
This is great! Will review when you mark "ready for review" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good. Not too concerned with the details of the internal/trace
package, so didn't review that closely.
Co-authored-by: Chad Retz <chad.retz@gmail.com>
temporalcli/commandsmd/commands.md
Outdated
|
||
#### Options | ||
|
||
* `--fold` (string) - Statuses for which Child Workflows will be folded in (this will reduce the number of information fetched and displayed). Case-insensitive and ignored if no-fold supplied. Available values: running, completed, failed, canceled, terminated, timedout, continueasnew. Default: completed,canceled,terminated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we supported it, would suggest string-enum[]
as the type, but in the meantime, might as well just have string[]
as the type. This allows them to specify --fold
multiple times instead of using commas. However, default not supported for string[]
. You can either add support in commandsmd/code.go
or just have something like "Default is completed, canceled, terminated" which won't trigger the parser and let you set the default at runtime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to do this is a later iteration so we can move this (already pretty big thing) forward. Does this work for you? Tbh, I think this is a flag that will very rarely be used, since the provided default is the most reasonable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but it will be a backwards-incompatible alteration at that time unfortunately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you pass multiple statuses to a single instance of --fold
? The help text says "Statuses", which makes me think this is possible, but we should make it explicit in the help text that commas are needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would y'all feel about not using the flag for now and working this out in a future PR? I think it's a non-trivial decision that we would benefit from putting some good thinking behind (and not delay this PR).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will defer to @josh-berry. I do think however it is fairly trivial to just change this to string[]
and wait until you see an empty slice at runtime to set the default 3 values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not having the flag and adding it later is fine by me; so is accepting []string
. The only thing I'm not thrilled about is making a breaking change (i.e. commas now and []string
later).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 @sebneira - can you make this type string[]
and set the defaults in code on empty slice when no-fold is not set? You can still write "Defaults are completed, canceled, and terminated." and it won't be read as a special option like Default:
is.
I think after this we can merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion. I updated the PR to include the string[]
flag for fold which defaults to the completed, canceled and terminated if the flag is empty.
Also, as I was moving the options struct around it kinda dawned on me that the pkg made more sense as tracer
rather than trace
. Let me know if this doesn't make sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Not too concerned with internal package name (workflowtrace
is probably the best tbh, but doesn't really matter here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just pedantic stuff (would like to see fixed since easy though if you don't mind). Marking approved, LGTM overall.
Co-authored-by: Chad Retz <chad.retz@gmail.com>
Co-authored-by: Chad Retz <chad.retz@gmail.com>
Co-authored-by: Chad Retz <chad.retz@gmail.com>
3f78c09
to
2cb72b3
Compare
16d6c03
to
277447f
Compare
What was changed
Ported over trace to the new cli rewrite.
Added a couple of fixes to get this to work:
WorkflowTracer
(see Minor refactor and fixes to workflow trace #507 for the isolated changes). This was the initial fix I was working on. This should remove the issues when state == nil and the weirdness with thesetupUpdateChannels
.GetDuration
andGetStartTime
time reference since the events now usedurationpb.Duration
andtimestamppb.Timestamp
and the conversion to non-pointer values makes more sense. Adjusted the templates to present this data correctly.Why?
Ported the command to the cli rewrite and provided fixes for the nil pointer issues reported by Chad.
Checklist
Closes
How was this tested:
All unit tests are running and I've run the tool against a couple different workflow executions with temporalite.