Skip to content

Commit

Permalink
Add VTAdmin integration
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Lord <[email protected]>
  • Loading branch information
mattlord committed Feb 18, 2025
1 parent 4d0d779 commit e8e551d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion go/vt/vtadmin/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,8 @@ type FindWorkflowsOptions struct {
ActiveOnly bool
IgnoreKeyspaces sets.Set[string]
Filter func(workflow *vtadminpb.Workflow) bool
VerbosityLevel vtctldatapb.VerbosityLevel
IncludeLogs bool
}

// FindWorkflows returns a list of Workflows in this cluster, across the given
Expand Down Expand Up @@ -759,6 +761,8 @@ func (c *Cluster) findWorkflows(ctx context.Context, keyspaces []string, opts Fi
span.Annotate("keyspaces", strings.Join(keyspaces, ","))
span.Annotate("num_ignore_keyspaces", opts.IgnoreKeyspaces.Len())
span.Annotate("ignore_keyspaces", strings.Join(sets.List(opts.IgnoreKeyspaces), ","))
span.Annotate("include_logs", opts.IncludeLogs)
span.Annotate("verbosity_level", opts.VerbosityLevel.String())
}

clusterpb := c.ToProto()
Expand Down Expand Up @@ -799,7 +803,8 @@ func (c *Cluster) findWorkflows(ctx context.Context, keyspaces []string, opts Fi
resp, err := c.Vtctld.GetWorkflows(ctx, &vtctldatapb.GetWorkflowsRequest{
Keyspace: ks,
ActiveOnly: opts.ActiveOnly,
IncludeLogs: true,
IncludeLogs: opts.IncludeLogs,
Verbosity: opts.VerbosityLevel,
})
c.workflowReadPool.Release()

Expand Down Expand Up @@ -2023,6 +2028,8 @@ func (c *Cluster) GetWorkflow(ctx context.Context, keyspace string, name string,
Filter: func(workflow *vtadminpb.Workflow) bool {
return workflow.Workflow.Name == name
},
VerbosityLevel: vtctldatapb.VerbosityLevel_HIGH,
IncludeLogs: true,
})
if err != nil {
return nil, err
Expand Down Expand Up @@ -2067,6 +2074,8 @@ func (c *Cluster) GetWorkflows(ctx context.Context, keyspaces []string, opts Get
ActiveOnly: opts.ActiveOnly,
IgnoreKeyspaces: opts.IgnoreKeyspaces,
Filter: func(_ *vtadminpb.Workflow) bool { return true },
IncludeLogs: false,
VerbosityLevel: vtctldatapb.VerbosityLevel_LOW,
})
}

Expand Down

0 comments on commit e8e551d

Please sign in to comment.