Skip to content

Commit

Permalink
Add local_activity_execution_failed metric (#966)
Browse files Browse the repository at this point in the history
Add local_activity_execution_failed and mark local_activity_failed
as deprecated to align with java sdk.
  • Loading branch information
Quinn-With-Two-Ns authored Nov 29, 2022
1 parent 86b0ef6 commit a23dec9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 8 additions & 6 deletions internal/common/metrics/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ const (
ActivitySucceedEndToEndLatency = TemporalMetricsPrefix + "activity_succeed_endtoend_latency"
ActivityTaskErrorCounter = TemporalMetricsPrefix + "activity_task_error"

LocalActivityTotalCounter = TemporalMetricsPrefix + "local_activity_total"
LocalActivityCanceledCounter = TemporalMetricsPrefix + "local_activity_canceled"
LocalActivityFailedCounter = TemporalMetricsPrefix + "local_activity_failed"
LocalActivityErrorCounter = TemporalMetricsPrefix + "local_activity_error"
LocalActivityExecutionLatency = TemporalMetricsPrefix + "local_activity_execution_latency"
LocalActivitySucceedEndToEndLatency = TemporalMetricsPrefix + "local_activity_succeed_endtoend_latency"
LocalActivityTotalCounter = TemporalMetricsPrefix + "local_activity_total"
LocalActivityCanceledCounter = TemporalMetricsPrefix + "local_activity_canceled" // Deprecated: Use LocalActivityExecutionCanceledCounter instead.
LocalActivityExecutionCanceledCounter = TemporalMetricsPrefix + "local_activity_execution_cancelled"
LocalActivityFailedCounter = TemporalMetricsPrefix + "local_activity_failed" // Deprecated: Use LocalActivityExecutionFailedCounter instead.
LocalActivityExecutionFailedCounter = TemporalMetricsPrefix + "local_activity_execution_failed"
LocalActivityErrorCounter = TemporalMetricsPrefix + "local_activity_error"
LocalActivityExecutionLatency = TemporalMetricsPrefix + "local_activity_execution_latency"
LocalActivitySucceedEndToEndLatency = TemporalMetricsPrefix + "local_activity_succeed_endtoend_latency"

CorruptedSignalsCounter = TemporalMetricsPrefix + "corrupted_signals"

Expand Down
2 changes: 2 additions & 0 deletions internal/internal_task_pollers.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ func (lath *localActivityTaskHandler) executeLocalActivityTask(task *localActivi
}
if err != nil {
metricsHandler.Counter(metrics.LocalActivityFailedCounter).Inc(1)
metricsHandler.Counter(metrics.LocalActivityExecutionFailedCounter).Inc(1)
}
}()

Expand Down Expand Up @@ -586,6 +587,7 @@ WaitResult:
// context is done
if ctx.Err() == context.Canceled {
metricsHandler.Counter(metrics.LocalActivityCanceledCounter).Inc(1)
metricsHandler.Counter(metrics.LocalActivityExecutionCanceledCounter).Inc(1)
return &localActivityResult{err: ErrCanceled, task: task}
} else if ctx.Err() == context.DeadlineExceeded {
return &localActivityResult{err: ErrDeadlineExceeded, task: task}
Expand Down

0 comments on commit a23dec9

Please sign in to comment.