Skip to content

Commit

Permalink
Adjust action metrics (#5043)
Browse files Browse the repository at this point in the history
<!-- Describe what has changed in this PR -->
**What changed?**
Adjust action metrics

<!-- Tell your future self why have you made these changes -->
**Why?**
To reflect # change.

<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->
**How did you test it?**
Run locally and verify metrics.

<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->
**Potential risks**
No

<!-- Is this PR a hotfix candidate or require that a notification be
sent to the broader community? (Yes/No) -->
**Is hotfix candidate?**
  • Loading branch information
yiminc authored and rodrigozhou committed Oct 31, 2023
1 parent 91425ba commit 0fc50f8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions common/rpc/interceptor/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,10 @@ func (ti *TelemetryInterceptor) emitActionMetric(
case enums.COMMAND_TYPE_RECORD_MARKER:
// handle RecordMarker command, they are used for localActivity, sideEffect, versioning etc.
hasMarker = true
markerName := command.GetRecordMarkerCommandAttributes().GetMarkerName()
metricsHandler.Counter(metrics.ActionCounter.GetMetricName()).Record(1, metrics.ActionType("command_RecordMarker_"+markerName))
case enums.COMMAND_TYPE_START_CHILD_WORKFLOW_EXECUTION:
// Each child workflow counts as 2 actions. We use separate tags to track them separately.
metricsHandler.Counter(metrics.ActionCounter.GetMetricName()).Record(1, metrics.ActionType("command_"+command.CommandType.String()))
metricsHandler.Counter(metrics.ActionCounter.GetMetricName()).Record(1, metrics.ActionType("command_"+command.CommandType.String()+"_Extra"))
default:
// handle all other command action
metricsHandler.Counter(metrics.ActionCounter.GetMetricName()).Record(1, metrics.ActionType("command_"+command.CommandType.String()))
Expand Down

0 comments on commit 0fc50f8

Please # to comment.