Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/metrics/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var HistogramMigrationMetrics = map[string]struct{}{
// Replication task processor histograms (PR #7685).
// Dual-emitted as timer + histogram.
"replication_tasks_lag": {},
"replication_tasks_lag_ns": {},
"replication_tasks_lag_counts": {},
"replication_tasks_applied_latency": {},
"replication_tasks_applied_latency_ns": {},

Expand Down
2 changes: 1 addition & 1 deletion common/metrics/defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3541,7 +3541,7 @@ var MetricDefs = map[ServiceIdx]map[MetricIdx]metricDefinition{
ReplicationTasksApplied: {metricName: "replication_tasks_applied", metricType: Counter},
ReplicationTasksFailed: {metricName: "replication_tasks_failed", metricType: Counter},
ReplicationTasksLag: {metricName: "replication_tasks_lag", metricType: Timer},
ExponentialReplicationTasksLag: {metricName: "replication_tasks_lag_ns", metricType: Histogram, exponentialBuckets: Mid1ms24h},
ExponentialReplicationTasksLag: {metricName: "replication_tasks_lag_counts", metricType: Histogram, intExponentialBuckets: Mid1To16k},
ReplicationTasksLagRaw: {metricName: "replication_tasks_lag_raw", metricType: Timer},
ReplicationTasksDelay: {metricName: "replication_tasks_delay", metricType: Histogram, buckets: ReplicationTaskDelayBucket},
ReplicationTasksFetched: {metricName: "replication_tasks_fetched", metricType: Timer},
Expand Down
6 changes: 3 additions & 3 deletions service/history/replication/task_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,12 @@ func (p *taskProcessorImpl) cleanupAckedReplicationTasks() error {
persistence.HistoryTaskCategoryReplication,
p.currentCluster,
).GetTaskID()
lag := time.Duration(maxReadLevel - minAckLevel)
lagCount := int(maxReadLevel - minAckLevel)
scope := p.metricsClient.Scope(metrics.ReplicationTaskFetcherScope,
metrics.TargetClusterTag(p.currentCluster),
)
scope.RecordTimer(metrics.ReplicationTasksLag, lag)
scope.ExponentialHistogram(metrics.ExponentialReplicationTasksLag, lag)
scope.RecordTimer(metrics.ReplicationTasksLag, time.Duration(lagCount))
scope.IntExponentialHistogram(metrics.ExponentialReplicationTasksLag, lagCount)
for {
pageSize := p.config.ReplicatorTaskDeleteBatchSize()
resp, err := p.shard.GetExecutionManager().RangeCompleteHistoryTask(
Expand Down
Loading