Skip to content
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

Use separate metric for resource exhausted error in task processing #3463

Merged
merged 1 commit into from
Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 7 additions & 6 deletions service/history/queues/executable.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,19 +237,20 @@ func (e *executableImpl) HandleErr(err error) (retErr error) {
e.taggedMetricsHandler.Histogram(TaskAttempt, metrics.Dimensionless).Record(int64(e.attempt))
e.logger.Error("Critical error processing task, retrying.", tag.Error(err), tag.OperationCritical)
}

if common.IsResourceExhausted(retErr) {
e.resourceExhaustedCount++
} else {
e.resourceExhaustedCount = 0
}
}
}()

if err == nil {
return nil
}

if common.IsResourceExhausted(err) {
e.resourceExhaustedCount++
e.taggedMetricsHandler.Counter(TaskThrottledCounter).Record(1)
return err
}
e.resourceExhaustedCount = 0

if _, isNotFound := err.(*serviceerror.NotFound); isNotFound {
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion service/history/queues/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const (
TaskStandbyRetryCounter = "task_errors_standby_retry_counter"
TaskWorkflowBusyCounter = "task_errors_workflow_busy"
TaskNotActiveCounter = "task_errors_not_active_counter"
TaskThrottledCounter = "task_errors_throttled"
TaskLoadLatency = "task_latency_load" // latency from task generation to task loading (persistence scheduleToStart)
TaskScheduleLatency = "task_latency_schedule" // latency from task submission to in-memory queue to processing (in-memory scheduleToStart)
TaskProcessingLatency = "task_latency_processing" // latency for processing task one time
Expand All @@ -53,7 +54,6 @@ const (
TaskNoUserQueueLatency = "task_latency_queue_nouserlatency" // same as TaskQueueLatency, but excludes workflow lock latency
TaskUserLatency = "task_latency_userlatency" // workflow lock latency across multiple attempts
TaskReschedulerPendingTasks = "task_rescheduler_pending_tasks"
TaskThrottledCounter = "task_throttled_counter"
TasksDependencyTaskNotCompleted = "task_dependency_task_not_completed"

TaskBatchCompleteCounter = "task_batch_complete_counter"
Expand Down