mirror of
https://github.com/hanzoai/tasks.git
synced 2026-10-04 02:04:03 +00:00
fix: event metrics with missing tags (#10268)
## What changed? Add `WithTags(metrics.CommandType(Unspecified))` to the call sites for Workflow Update event_blob_size metric emission, which was missing in the pathch #10253 to the problem introduced in #10223 ## Why? Fixes a warning and dropped metric when the metrics handler has different shapes ## How did you test it? - [ ] built - [X] run locally and tested manually: Ran server with `make start`, created a simple workflow with an update handler, start the worker, start a workflow, and send the update. Grepped server logs for `error in prometheus reporter` and `event_blob_size` and curled the metrics endpoint `curl -s http://127.0.0.1:8000/metrics > /tmp/snapshot.txt` - [ ] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) ## Potential risks Minimal, fixing bug
This commit is contained in:
@@ -786,7 +786,7 @@ func (wh *WorkflowHandler) ExecuteMultiOperation(
|
||||
return nil, errMultiOpNotStartAndUpdate
|
||||
}
|
||||
|
||||
metrics.EventBlobSize.With(wh.metricsScope(ctx)).Record(int64(request.Operations[1].GetUpdateWorkflow().GetRequest().GetInput().GetArgs().Size()), metrics.OperationTag("UpdateWorkflowExecution"))
|
||||
metrics.EventBlobSize.With(wh.metricsScope(ctx).WithTags(metrics.CommandTypeTag(enumspb.COMMAND_TYPE_UNSPECIFIED.String()))).Record(int64(request.Operations[1].GetUpdateWorkflow().GetRequest().GetInput().GetArgs().Size()), metrics.OperationTag("UpdateWorkflowExecution"))
|
||||
|
||||
historyReq, err := wh.convertToHistoryMultiOperationRequest(ctx, namespaceID, request)
|
||||
if err != nil {
|
||||
@@ -5332,7 +5332,7 @@ func (wh *WorkflowHandler) UpdateWorkflowExecution(
|
||||
|
||||
metricsHandler := wh.metricsScope(ctx).WithTags(metrics.HeaderCallsiteTag("UpdateWorkflowExecution"))
|
||||
metrics.HeaderSize.With(metricsHandler).Record(int64(request.GetRequest().GetInput().GetHeader().Size()))
|
||||
metrics.EventBlobSize.With(wh.metricsScope(ctx)).Record(int64(request.GetRequest().GetInput().GetArgs().Size()), metrics.OperationTag("UpdateWorkflowExecution"))
|
||||
metrics.EventBlobSize.With(wh.metricsScope(ctx).WithTags(metrics.CommandTypeTag(enumspb.COMMAND_TYPE_UNSPECIFIED.String()))).Record(int64(request.GetRequest().GetInput().GetArgs().Size()), metrics.OperationTag("UpdateWorkflowExecution"))
|
||||
|
||||
switch request.WaitPolicy.LifecycleStage { // nolint:exhaustive
|
||||
case enumspb.UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_ACCEPTED:
|
||||
|
||||
Reference in New Issue
Block a user