| 30 | } |
| 31 | |
| 32 | func (cmd *redactCmd) Run(_ *globalOptions) error { |
| 33 | traceIDs, err := parseTraceIDs(cmd.TraceIDs) |
| 34 | if err != nil { |
| 35 | return err |
| 36 | } |
| 37 | |
| 38 | transportCred, err := cmd.buildTransportCredentials() |
| 39 | if err != nil { |
| 40 | return fmt.Errorf("building transport credentials: %w", err) |
| 41 | } |
| 42 | |
| 43 | c, err := schedulerclient.NewWithOptions(cmd.SchedulerAddr, defaultSchedulerClientConfig(), transportCred) |
| 44 | if err != nil { |
| 45 | return fmt.Errorf("creating scheduler client: %w", err) |
| 46 | } |
| 47 | defer c.Close() |
| 48 | |
| 49 | resp, err := cmd.submit(context.Background(), c, traceIDs) |
| 50 | if err != nil { |
| 51 | return err |
| 52 | } |
| 53 | |
| 54 | fmt.Printf("batch_id: %s\njobs_created: %d\n", resp.BatchId, resp.JobsCreated) |
| 55 | return nil |
| 56 | } |
| 57 | |
| 58 | // submit injects the tenant org ID into the outgoing gRPC metadata and calls SubmitRedaction. |
| 59 | func (cmd *redactCmd) submit(ctx context.Context, c tempopb.BackendSchedulerClient, traceIDs [][]byte) (*tempopb.SubmitRedactionResponse, error) { |