Skip to content

Commit

Permalink
reduce unnecessary logging (#2549)
Browse files Browse the repository at this point in the history
  • Loading branch information
yiminc committed Feb 25, 2022
1 parent 3b6d586 commit a9a22a1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
11 changes: 10 additions & 1 deletion client/history/metricClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ package history
import (
"context"

"go.temporal.io/api/serviceerror"
"google.golang.org/grpc"

"go.temporal.io/server/api/historyservice/v1"
Expand Down Expand Up @@ -617,7 +618,15 @@ func (c *metricClient) finishMetricsRecording(
err error,
) {
if err != nil {
c.throttledLogger.Error("history client encountered error", tag.Error(err), tag.ErrorType(err))
switch err.(type) {
case *serviceerror.Canceled,
*serviceerror.DeadlineExceeded,
*serviceerror.NotFound,
*serviceerror.WorkflowExecutionAlreadyStarted:
// noop - not interest and too many logs
default:
c.throttledLogger.Error("history client encountered error", tag.Error(err), tag.ErrorType(err))
}
scope.Tagged(metrics.ServiceErrorTypeTag(err)).IncCounter(metrics.ClientFailures)
}
stopwatch.Stop()
Expand Down
12 changes: 11 additions & 1 deletion client/matching/metricClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"context"
"strings"

"go.temporal.io/api/serviceerror"
taskqueuepb "go.temporal.io/api/taskqueue/v1"
"google.golang.org/grpc"

Expand Down Expand Up @@ -256,7 +257,16 @@ func (c *metricClient) finishMetricsRecording(
err error,
) {
if err != nil {
c.throttledLogger.Error("matching client encountered error", tag.Error(err), tag.ErrorType(err))
switch err.(type) {
case *serviceerror.Canceled,
*serviceerror.DeadlineExceeded,
*serviceerror.NotFound,
*serviceerror.WorkflowExecutionAlreadyStarted:
// noop - not interest and too many logs
default:

c.throttledLogger.Error("matching client encountered error", tag.Error(err), tag.ErrorType(err))
}
scope.Tagged(metrics.ServiceErrorTypeTag(err)).IncCounter(metrics.ClientFailures)
}
stopwatch.Stop()
Expand Down
2 changes: 1 addition & 1 deletion service/history/replicationTaskProcessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ func (p *ReplicationTaskProcessorImpl) cleanupReplicationTasks() error {
return nil
}

p.logger.Info("cleaning up replication task queue", tag.ReadLevel(*minAckedTaskID))
p.logger.Debug("cleaning up replication task queue", tag.ReadLevel(*minAckedTaskID))
p.metricsClient.Scope(metrics.ReplicationTaskCleanupScope).IncCounter(metrics.ReplicationTaskCleanupCount)
p.metricsClient.Scope(
metrics.ReplicationTaskFetcherScope,
Expand Down

0 comments on commit a9a22a1

Please sign in to comment.