Skip to content

Commit 0383b18

Browse files
authored
[Wf-Diagnostics] use current clustername for emission of usage logs (#6678)
* [Wf-Diagnostics] use current clustername for emission of usage logs * Update module.go
1 parent e36c818 commit 0383b18

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

service/worker/diagnostics/module.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import (
3434

3535
"github.com/uber/cadence/client"
3636
"github.com/uber/cadence/common"
37+
"github.com/uber/cadence/common/cluster"
3738
"github.com/uber/cadence/common/log"
3839
"github.com/uber/cadence/common/messaging"
3940
"github.com/uber/cadence/common/metrics"
@@ -54,6 +55,7 @@ type dw struct {
5455
tallyScope tally.Scope
5556
worker worker.Worker
5657
invariants []invariant.Invariant
58+
clusterMetadata cluster.Metadata
5759
}
5860

5961
type Params struct {
@@ -64,6 +66,7 @@ type Params struct {
6466
Logger log.Logger
6567
TallyScope tally.Scope
6668
Invariants []invariant.Invariant
69+
ClusterMetadata cluster.Metadata
6770
}
6871

6972
// New creates a new diagnostics workflow.
@@ -76,6 +79,7 @@ func New(params Params) DiagnosticsWorkflow {
7679
clientBean: params.ClientBean,
7780
logger: params.Logger,
7881
invariants: params.Invariants,
82+
clusterMetadata: params.ClusterMetadata,
7983
}
8084
}
8185

service/worker/diagnostics/parent_workflow.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ func (w *dw) DiagnosticsStarterWorkflow(ctx workflow.Context, params Diagnostics
9999
RunID: params.RunID,
100100
Identity: params.Identity,
101101
IssueType: getIssueType(diagWfResult),
102+
Environment: w.clusterMetadata.GetCurrentClusterName(),
102103
DiagnosticsWorkflowID: childWfExec.ID,
103104
DiagnosticsRunID: childWfExec.RunID,
104105
DiagnosticsStartTime: childWfStart,

service/worker/service.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ func (s *Service) startDiagnostics() {
350350
ClientBean: s.GetClientBean(),
351351
Logger: s.GetLogger(),
352352
Invariants: s.params.DiagnosticsInvariants,
353+
ClusterMetadata: s.GetClusterMetadata(),
353354
}
354355
if err := diagnostics.New(params).Start(); err != nil {
355356
s.Stop()

0 commit comments

Comments
 (0)