Skip to content

Commit

Permalink
Add source_cluster tag when emitting DLQ size (uber#4782)
Browse files Browse the repository at this point in the history
  • Loading branch information
vytautas-karpavicius authored Mar 29, 2022
1 parent ba4a5d9 commit 33edece
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions common/metrics/tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const (

instance = "instance"
domain = "domain"
sourceCluster = "source_cluster"
targetCluster = "target_cluster"
activeCluster = "active_cluster"
taskList = "tasklist"
Expand Down Expand Up @@ -92,6 +93,11 @@ func InstanceTag(value string) Tag {
return simpleMetric{key: instance, value: value}
}

// SourceClusterTag returns a new source cluster tag.
func SourceClusterTag(value string) Tag {
return metricWithUnknown(sourceCluster, value)
}

// TargetClusterTag returns a new target cluster tag.
func TargetClusterTag(value string) Tag {
return metricWithUnknown(targetCluster, value)
Expand Down
1 change: 1 addition & 0 deletions service/history/replication/task_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,7 @@ func (p *taskProcessorImpl) emitDLQSizeMetricsLoop() {
} else {
p.metricsClient.Scope(
metrics.ReplicationDLQStatsScope,
metrics.SourceClusterTag(p.sourceCluster),
metrics.InstanceTag(strconv.Itoa(p.shard.GetShardID())),
).UpdateGauge(metrics.ReplicationDLQSize, float64(resp.Size))
}
Expand Down

0 comments on commit 33edece

Please sign in to comment.