diff --git a/common/metrics/defs.go b/common/metrics/defs.go index 8d3cb9b90e0..61ef2092597 100644 --- a/common/metrics/defs.go +++ b/common/metrics/defs.go @@ -2020,6 +2020,7 @@ const ( PersistenceErrExecutionAlreadyStartedCounter PersistenceErrDomainAlreadyExistsCounter PersistenceErrBadRequestCounter + PersistenceErrDuplicateRequestCounter PersistenceErrDBUnavailableCounter PersistenceSampledCounter PersistenceEmptyResponseCounter @@ -2039,6 +2040,7 @@ const ( PersistenceErrExecutionAlreadyStartedCounterPerDomain PersistenceErrDomainAlreadyExistsCounterPerDomain PersistenceErrBadRequestCounterPerDomain + PersistenceErrDuplicateRequestCounterPerDomain PersistenceErrDBUnavailableCounterPerDomain PersistenceSampledCounterPerDomain PersistenceEmptyResponseCounterPerDomain @@ -2642,6 +2644,7 @@ var MetricDefs = map[ServiceIdx]map[int]metricDefinition{ PersistenceErrExecutionAlreadyStartedCounter: {metricName: "persistence_errors_execution_already_started", metricType: Counter}, PersistenceErrDomainAlreadyExistsCounter: {metricName: "persistence_errors_domain_already_exists", metricType: Counter}, PersistenceErrBadRequestCounter: {metricName: "persistence_errors_bad_request", metricType: Counter}, + PersistenceErrDuplicateRequestCounter: {metricName: "persistence_errors_duplicate_request", metricType: Counter}, PersistenceErrDBUnavailableCounter: {metricName: "persistence_errors_db_unavailable", metricType: Counter}, PersistenceSampledCounter: {metricName: "persistence_sampled", metricType: Counter}, PersistenceEmptyResponseCounter: {metricName: "persistence_empty_response", metricType: Counter}, @@ -2660,6 +2663,7 @@ var MetricDefs = map[ServiceIdx]map[int]metricDefinition{ PersistenceErrExecutionAlreadyStartedCounterPerDomain: {metricName: "persistence_errors_execution_already_started_per_domain", metricRollupName: "persistence_errors_execution_already_started", metricType: Counter}, PersistenceErrDomainAlreadyExistsCounterPerDomain: {metricName: "persistence_errors_domain_already_exists_per_domain", metricRollupName: "persistence_errors_domain_already_exists", metricType: Counter}, PersistenceErrBadRequestCounterPerDomain: {metricName: "persistence_errors_bad_request_per_domain", metricRollupName: "persistence_errors_bad_request", metricType: Counter}, + PersistenceErrDuplicateRequestCounterPerDomain: {metricName: "persistence_errors_duplicate_request_per_domain", metricRollupName: "persistence_errors_duplicate_request", metricType: Counter}, PersistenceErrDBUnavailableCounterPerDomain: {metricName: "persistence_errors_db_unavailable_per_domain", metricRollupName: "persistence_errors_db_unavailable", metricType: Counter}, PersistenceSampledCounterPerDomain: {metricName: "persistence_sampled_per_domain", metricRollupName: "persistence_sampled", metricType: Counter}, PersistenceEmptyResponseCounterPerDomain: {metricName: "persistence_empty_response_per_domain", metricRollupName: "persistence_empty_response", metricType: Counter}, diff --git a/common/persistence/wrappers/metered/base.go b/common/persistence/wrappers/metered/base.go index ab3e40981b3..576ce83b235 100644 --- a/common/persistence/wrappers/metered/base.go +++ b/common/persistence/wrappers/metered/base.go @@ -59,6 +59,8 @@ func (p *base) updateErrorMetricPerDomain(scope int, err error, scopeWithDomainT scopeWithDomainTag.IncCounter(metrics.PersistenceErrShardOwnershipLostCounterPerDomain) case *types.EntityNotExistsError: scopeWithDomainTag.IncCounter(metrics.PersistenceErrEntityNotExistsCounterPerDomain) + case *persistence.DuplicateRequestError: + scopeWithDomainTag.IncCounter(metrics.PersistenceErrDuplicateRequestCounterPerDomain) case *persistence.TimeoutError: scopeWithDomainTag.IncCounter(metrics.PersistenceErrTimeoutCounterPerDomain) scopeWithDomainTag.IncCounter(metrics.PersistenceFailuresPerDomain) @@ -93,6 +95,8 @@ func (p *base) updateErrorMetric(scope int, err error, metricsScope metrics.Scop metricsScope.IncCounter(metrics.PersistenceErrShardOwnershipLostCounter) case *types.EntityNotExistsError: metricsScope.IncCounter(metrics.PersistenceErrEntityNotExistsCounter) + case *persistence.DuplicateRequestError: + metricsScope.IncCounter(metrics.PersistenceErrDuplicateRequestCounter) case *persistence.TimeoutError: metricsScope.IncCounter(metrics.PersistenceErrTimeoutCounter) metricsScope.IncCounter(metrics.PersistenceFailures)