Skip to content

Commit

Permalink
Use the same value for shard tag of metric reporter (cadence-workflow…
Browse files Browse the repository at this point in the history
…#245)

* Use the same value for shard tag of metric reporter

Emitting a shard tag for all metric becomes unmanageable when you run
the server with large number of shards.  Using a constant value for now.
  • Loading branch information
samarabbas authored Jun 17, 2017
1 parent b10cd30 commit 348ad84
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion common/metrics/defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,14 @@ const (
const (
HostnameTagName = "hostname"
OperationTagName = "operation"
ShardTagName = "shard"
// ShardTagName is temporary until we can get all metric data removed for the service
ShardTagName = "shard"
)

// This package should hold all the metrics and tags for cadence
const (
UnknownDirectoryTagValue = "Unknown"
AllShardsTagValue = "ALL"
)

// Common service base metrics
Expand Down
2 changes: 1 addition & 1 deletion service/history/execMgrFactory.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (factory *executionMgrFactory) CreateExecutionManager(shardID int) (persist
}

tags := map[string]string{
metrics.ShardTagName: string(shardID),
metrics.ShardTagName: metrics.AllShardsTagValue,
}
return persistence.NewWorkflowExecutionPersistenceClient(mgr, factory.metricsClient.Tagged(tags)), nil
}
2 changes: 1 addition & 1 deletion service/history/shardContext.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ func acquireShard(shardID int, shardManager persistence.ShardManager, historyMgr
logging.TagHistoryShardID: shardID,
})
tags := map[string]string{
metrics.ShardTagName: string(shardID),
metrics.ShardTagName: metrics.AllShardsTagValue,
}
context.metricsClient = reporter.Tagged(tags)

Expand Down

0 comments on commit 348ad84

Please sign in to comment.