(_ *globalOptions)
| 32 | } |
| 33 | |
| 34 | func (cmd *metricsQueryCmd) Run(_ *globalOptions) error { |
| 35 | startDate, err := parseTime(cmd.Start) |
| 36 | if err != nil { |
| 37 | return err |
| 38 | } |
| 39 | start := startDate.UnixNano() |
| 40 | |
| 41 | endDate, err := parseTime(cmd.End) |
| 42 | if err != nil { |
| 43 | return err |
| 44 | } |
| 45 | end := endDate.UnixNano() |
| 46 | |
| 47 | if cmd.Instant { |
| 48 | req := &tempopb.QueryInstantRequest{ |
| 49 | Query: cmd.TraceQL, |
| 50 | Start: uint64(start), |
| 51 | End: uint64(end), |
| 52 | } |
| 53 | |
| 54 | if cmd.UseGRPC { |
| 55 | return cmd.queryInstantGRPC(req) |
| 56 | } |
| 57 | |
| 58 | return cmd.queryInstantHTTP(req) |
| 59 | } |
| 60 | |
| 61 | req := &tempopb.QueryRangeRequest{ |
| 62 | Query: cmd.TraceQL, |
| 63 | Start: uint64(start), |
| 64 | End: uint64(end), |
| 65 | } |
| 66 | |
| 67 | if cmd.UseGRPC { |
| 68 | return cmd.queryRangeGRPC(req) |
| 69 | } |
| 70 | |
| 71 | return cmd.queryRangeHTTP(req) |
| 72 | } |
| 73 | |
| 74 | func (cmd *metricsQueryCmd) queryRangeGRPC(req *tempopb.QueryRangeRequest) error { |
| 75 | ctx := user.InjectOrgID(context.Background(), cmd.OrgID) |
nothing calls this directly
no test coverage detected