Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading