Skip to content

Commit ffefac1

Browse files
authored
Bring back shard id tag (#262)
1 parent 552ca7a commit ffefac1

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

common/metrics/defs.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,14 @@ const (
6464
const (
6565
HostnameTagName = "hostname"
6666
OperationTagName = "operation"
67+
// ShardTagName is temporary until we can get all metric data removed for the service
68+
ShardTagName = "shard"
6769
)
6870

6971
// This package should hold all the metrics and tags for cadence
7072
const (
7173
UnknownDirectoryTagValue = "Unknown"
74+
AllShardsTagValue = "ALL"
7275
)
7376

7477
// Common service base metrics

service/history/execMgrFactory.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,9 @@ func (factory *executionMgrFactory) CreateExecutionManager(shardID int) (persist
5959
if err != nil {
6060
return nil, err
6161
}
62-
return persistence.NewWorkflowExecutionPersistenceClient(mgr, factory.metricsClient), nil
62+
tags := map[string]string{
63+
metrics.ShardTagName: metrics.AllShardsTagValue,
64+
}
65+
return persistence.NewWorkflowExecutionPersistenceClient(
66+
mgr, factory.metricsClient.Tagged(tags)), nil
6367
}

service/history/shardContext.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,9 @@ func acquireShard(shardID int, shardManager persistence.ShardManager, historyMgr
442442
shardInfo := response.ShardInfo
443443
updatedShardInfo := copyShardInfo(shardInfo)
444444
updatedShardInfo.Owner = owner
445+
tags := map[string]string{
446+
metrics.ShardTagName: metrics.AllShardsTagValue,
447+
}
445448
context := &shardContextImpl{
446449
shardID: shardID,
447450
shardManager: shardManager,
@@ -450,7 +453,7 @@ func acquireShard(shardID int, shardManager persistence.ShardManager, historyMgr
450453
shardInfo: updatedShardInfo,
451454
rangeSize: defaultRangeSize,
452455
closeCh: closeCh,
453-
metricsClient: metricsClient,
456+
metricsClient: metricsClient.Tagged(tags),
454457
}
455458
context.logger = logger.WithFields(bark.Fields{
456459
logging.TagHistoryShardID: shardID,

0 commit comments

Comments
 (0)