Skip to content

Commit

Permalink
[Wf-Diagnostics] use current clustername for emission of usage logs (#…
Browse files Browse the repository at this point in the history
…6678)

* [Wf-Diagnostics] use current clustername for emission of usage logs

* Update module.go
  • Loading branch information
sankari165 authored Feb 19, 2025
1 parent e36c818 commit 0383b18
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions service/worker/diagnostics/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (

"github.com/uber/cadence/client"
"github.com/uber/cadence/common"
"github.com/uber/cadence/common/cluster"
"github.com/uber/cadence/common/log"
"github.com/uber/cadence/common/messaging"
"github.com/uber/cadence/common/metrics"
Expand All @@ -54,6 +55,7 @@ type dw struct {
tallyScope tally.Scope
worker worker.Worker
invariants []invariant.Invariant
clusterMetadata cluster.Metadata
}

type Params struct {
Expand All @@ -64,6 +66,7 @@ type Params struct {
Logger log.Logger
TallyScope tally.Scope
Invariants []invariant.Invariant
ClusterMetadata cluster.Metadata
}

// New creates a new diagnostics workflow.
Expand All @@ -76,6 +79,7 @@ func New(params Params) DiagnosticsWorkflow {
clientBean: params.ClientBean,
logger: params.Logger,
invariants: params.Invariants,
clusterMetadata: params.ClusterMetadata,
}
}

Expand Down
1 change: 1 addition & 0 deletions service/worker/diagnostics/parent_workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func (w *dw) DiagnosticsStarterWorkflow(ctx workflow.Context, params Diagnostics
RunID: params.RunID,
Identity: params.Identity,
IssueType: getIssueType(diagWfResult),
Environment: w.clusterMetadata.GetCurrentClusterName(),
DiagnosticsWorkflowID: childWfExec.ID,
DiagnosticsRunID: childWfExec.RunID,
DiagnosticsStartTime: childWfStart,
Expand Down
1 change: 1 addition & 0 deletions service/worker/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ func (s *Service) startDiagnostics() {
ClientBean: s.GetClientBean(),
Logger: s.GetLogger(),
Invariants: s.params.DiagnosticsInvariants,
ClusterMetadata: s.GetClusterMetadata(),
}
if err := diagnostics.New(params).Start(); err != nil {
s.Stop()
Expand Down

0 comments on commit 0383b18

Please sign in to comment.