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

Method Run

cmd/tempo-cli/cmd-query-search.go:35–61  ·  view source on GitHub ↗
(_ *globalOptions)

Source from the content-addressed store, hash-verified

33}
34
35func (cmd *querySearchCmd) Run(_ *globalOptions) error {
36 startDate, err := parseTime(cmd.Start)
37 if err != nil {
38 return err
39 }
40 start := startDate.Unix()
41
42 endDate, err := parseTime(cmd.End)
43 if err != nil {
44 return err
45 }
46 end := endDate.Unix()
47
48 req := &tempopb.SearchRequest{
49 Query: cmd.TraceQL,
50 Start: uint32(start),
51 End: uint32(end),
52 SpansPerSpanSet: uint32(cmd.SPSS),
53 Limit: uint32(cmd.Limit),
54 }
55
56 if cmd.UseGRPC {
57 return cmd.searchGRPC(req)
58 }
59
60 return cmd.searchHTTP(req)
61}
62
63func (cmd *querySearchCmd) searchGRPC(req *tempopb.SearchRequest) error {
64 ctx := user.InjectOrgID(context.Background(), cmd.OrgID)

Callers

nothing calls this directly

Calls 3

searchGRPCMethod · 0.95
searchHTTPMethod · 0.95
parseTimeFunction · 0.85

Tested by

no test coverage detected