MCPcopy
hub / github.com/grafana/tempo / Run

Method Run

cmd/tempo-cli/cmd-redact.go:32–56  ·  view source on GitHub ↗
(_ *globalOptions)

Source from the content-addressed store, hash-verified

30}
31
32func (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.
59func (cmd *redactCmd) submit(ctx context.Context, c tempopb.BackendSchedulerClient, traceIDs [][]byte) (*tempopb.SubmitRedactionResponse, error) {

Callers 15

TestWriteValidationTraceFunction · 0.45
TestRunValidationFunction · 0.45
TestInitTickersFunction · 0.45
TestQueryTraceFunction · 0.45
TestQueryMetricsFunction · 0.45
TestCreateHttpClientFunction · 0.45
TestParseTraceIDsFunction · 0.45
TestApplyHeadersHTTPFunction · 0.45
TestParseTimeFunction · 0.45
TestDetectModeFunction · 0.45

Calls 5

submitMethod · 0.95
parseTraceIDsFunction · 0.85
CloseMethod · 0.65

Tested by 15

TestWriteValidationTraceFunction · 0.36
TestRunValidationFunction · 0.36
TestInitTickersFunction · 0.36
TestQueryTraceFunction · 0.36
TestQueryMetricsFunction · 0.36
TestCreateHttpClientFunction · 0.36
TestParseTraceIDsFunction · 0.36
TestApplyHeadersHTTPFunction · 0.36
TestParseTimeFunction · 0.36
TestDetectModeFunction · 0.36