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

Method APIClientGRPC

integration/util/harness_api_reads.go:33–52  ·  view source on GitHub ↗
(tenant string)

Source from the content-addressed store, hash-verified

31}
32
33func (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
54func NewSearchGRPCClient(endpoint string, creds credentials.TransportCredentials) (tempopb.StreamingQuerierClient, error) {
55 clientConn, err := grpc.NewClient(endpoint, grpc.WithTransportCredentials(creds))

Callers 11

TestEncodingsFunction · 0.80
TestQueryRateLimitsFunction · 0.80
callQueryRangeFunction · 0.80
testSearchFunction · 0.80
TestTraceByIDandTraceQLFunction · 0.80
TestReadMetricsFunction · 0.80

Calls 1

NewSearchGRPCClientFunction · 0.85

Tested by 11

TestEncodingsFunction · 0.64
TestQueryRateLimitsFunction · 0.64
callQueryRangeFunction · 0.64
testSearchFunction · 0.64
TestTraceByIDandTraceQLFunction · 0.64
TestReadMetricsFunction · 0.64