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

Emit dedicated metrics for context cancelled #1628

Merged
merged 1 commit into from
Jun 14, 2021
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
2 changes: 2 additions & 0 deletions common/metrics/defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1616,6 +1616,7 @@ const (
ServiceErrNamespaceAlreadyExistsCounter
ServiceErrCancellationAlreadyRequestedCounter
ServiceErrQueryFailedCounter
ServiceErrContextCancelledCounter
ServiceErrContextTimeoutCounter
ServiceErrRetryTaskCounter
ServiceErrBadBinaryCounter
Expand Down Expand Up @@ -2044,6 +2045,7 @@ var MetricDefs = map[ServiceIdx]map[int]metricDefinition{
ServiceErrNamespaceAlreadyExistsCounter: {metricName: "service_errors_namespace_already_exists", metricType: Counter},
ServiceErrCancellationAlreadyRequestedCounter: {metricName: "service_errors_cancellation_already_requested", metricType: Counter},
ServiceErrQueryFailedCounter: {metricName: "service_errors_query_failed", metricType: Counter},
ServiceErrContextCancelledCounter: {metricName: "service_errors_context_cancelled", metricType: Counter},
ServiceErrContextTimeoutCounter: {metricName: "service_errors_context_timeout", metricType: Counter},
ServiceErrRetryTaskCounter: {metricName: "service_errors_retry_task", metricType: Counter},
ServiceErrBadBinaryCounter: {metricName: "service_errors_bad_binary", metricType: Counter},
Expand Down
6 changes: 5 additions & 1 deletion common/rpc/interceptor/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,14 @@ func (ti *TelemetryInterceptor) handleError(
err error,
) {

if common.IsContextDeadlineExceededErr(err) || common.IsContextCanceledErr(err) {
if common.IsContextDeadlineExceededErr(err) {
scope.IncCounter(metrics.ServiceErrContextTimeoutCounter)
return
}
if common.IsContextCanceledErr(err) {
scope.IncCounter(metrics.ServiceErrContextCancelledCounter)
return
}

switch err := err.(type) {
case *serviceerrors.ShardOwnershipLost:
Expand Down
2 changes: 1 addition & 1 deletion service/matching/matchingEngine.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ pollLoop:
}
}

// pollForActivityTaskOperation takes one task from the task manager, update workflow execution history, mark task as
// PollActivityTaskQueue takes one task from the task manager, update workflow execution history, mark task as
// completed and return it to user. If a task from task manager is already started, return an empty response, without
// error. Timeouts handled by the timer queue.
func (e *matchingEngineImpl) PollActivityTaskQueue(
Expand Down
2 changes: 1 addition & 1 deletion service/matching/taskQueueManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func newTaskQueueManager(
return tlMgr, nil
}

// Starts reading pump for the given task queue.
// Start reading pump for the given task queue.
// The pump fills up taskBuffer from persistence.
func (c *taskQueueManagerImpl) Start() error {
defer c.startWG.Done()
Expand Down