-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Versioning Metrics: pt1 #7822
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
Versioning Metrics: pt1 #7822
Conversation
34253fa to
cb580e2
Compare
| return nil, consts.ErrQueryEnteredInvalidState | ||
| } | ||
| case workflow.QueryCompletionTypeUnblocked: | ||
| msResp, err := api.GetMutableState(ctx, shardContext, workflowKey, workflowConsistencyChecker) |
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 sure pulling this call out is better :) I was suggesting to keep this part untouched. in line 182 you can get the behavior from the mutableState that we already have. (and then the behavior directly to emitWorkflowQueryMetrics)
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 I extract behaviour outside, then this block of code (which I have now restored) won't get the chance to pass the most up-to-date behaviour
what I have now done is just pass msResp according to the scope it's in
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.
why not? it can pass workflow.GetEffectiveVersioningBehavior(msResp.GetVersioningInfo()) instead of the old behavior
ShahabT
left a comment
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.
approved with a minor comment
| emitWorkflowQueryMetrics( | ||
| metricsHandler, | ||
| nsEntry, | ||
| msResp, |
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.
Nit: I still think the function should just get a behavior and we should pass workflow.GetEffectiveVersioningBehavior(msResp.GetVersioningInfo()) in here.
Then line 183 will just be behavior := mutableState.GetEffectiveBehavior() instead of msResp, err := api.MutableStateToGetResponse(mutableState)
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 thought about that too, but inside emitWorkflowQueryMetrics we are using msResp to generate two different tags - one for versioningBehaviour, the other for WorkflowStatus tag. Sure, one could argue we could just pass these two as separate arguments but I think it's easier to read when not done so - moreover, if we were to increase the number of tags on this metric, there's a high chance those new tags might come from a MS field and it'll be nice to have msResp be present.
What changed?
Metrics added in this PR are:
(Directly related to entity workflows)
(Not directly related to entity workflows)
Why?
How did you test it?
Potential risks