Skip to content

Commit

Permalink
Addition of domainName tag to Replication task (cadence-workflow#4975)
Browse files Browse the repository at this point in the history
What changes?
-- Added domain tag to replication task
-- Added new metrics for replication task : replication_task_applied_per_domain
  • Loading branch information
abhishekj720 authored Aug 26, 2022
1 parent 88991f2 commit c8783f0
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions service/history/replication/task_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,13 +448,16 @@ func (p *taskProcessorImpl) processTaskOnce(replicationTask *types.ReplicationTa
if err != nil {
p.updateFailureMetric(scope, err)
} else {
domainName, errorDomainName := p.shard.GetDomainCache().GetDomainName(replicationTask.HistoryTaskV2Attributes.DomainID)
if errorDomainName != nil {
return errorDomainName
}
now := ts.Now()
mScope := p.metricsClient.Scope(scope, metrics.TargetClusterTag(p.sourceCluster))
mScope.Tagged(metrics.DomainTag(domainName))
domainID := replicationTask.HistoryTaskV2Attributes.GetDomainID()
if domainID != "" {
domainName, errorDomainName := p.shard.GetDomainCache().GetDomainName(domainID)
if errorDomainName != nil {
return errorDomainName
}
mScope = mScope.Tagged(metrics.DomainTag(domainName))
}
// emit the number of replication tasks
mScope.IncCounter(metrics.ReplicationTasksAppliedPerDomain)
// emit single task processing latency
Expand Down

0 comments on commit c8783f0

Please sign in to comment.