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:
Sean Kane
2026-05-14 15:09:13 -06:00
committed by GitHub
parent 192ed9e97b
commit 85b30dafaa
+2 -2
View File
@@ -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: