| 31 | } |
| 32 | |
| 33 | func (h *TempoHarness) APIClientGRPC(tenant string) (tempopb.StreamingQuerierClient, context.Context, error) { |
| 34 | endpoint := h.Services[ServiceQueryFrontend].Endpoint(3200) |
| 35 | |
| 36 | ctx := context.Background() |
| 37 | |
| 38 | if tenant != "" { |
| 39 | ctx = user.InjectOrgID(ctx, tenant) |
| 40 | var err error |
| 41 | ctx, err = user.InjectIntoGRPCRequest(ctx) |
| 42 | if err != nil { |
| 43 | return nil, nil, err |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | client, err := NewSearchGRPCClient(endpoint, insecure.NewCredentials()) |
| 48 | if err != nil { |
| 49 | return nil, nil, err |
| 50 | } |
| 51 | return client, ctx, nil |
| 52 | } |
| 53 | |
| 54 | func NewSearchGRPCClient(endpoint string, creds credentials.TransportCredentials) (tempopb.StreamingQuerierClient, error) { |
| 55 | clientConn, err := grpc.NewClient(endpoint, grpc.WithTransportCredentials(creds)) |