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

Function TestOTLPLimits

integration/limits/limits_test.go:95–126  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

93}
94
95func TestOTLPLimits(t *testing.T) {
96 util.RunIntegrationTests(t, util.TestHarnessConfig{
97 ConfigOverlay: configIngest,
98 }, func(h *util.TempoHarness) {
99 h.WaitTracesWritable(t)
100 protoSpans := test.MakeProtoSpans(100)
101
102 // gRPC
103 grpcClient := otlptracegrpc.NewClient(
104 otlptracegrpc.WithEndpoint(h.Services[util.ServiceDistributor].Endpoint(4317)),
105 otlptracegrpc.WithInsecure(),
106 otlptracegrpc.WithRetry(otlptracegrpc.RetryConfig{Enabled: false}),
107 )
108 require.NoError(t, grpcClient.Start(context.Background()))
109
110 grpcErr := grpcClient.UploadTraces(context.Background(), protoSpans)
111 assert.Error(t, grpcErr)
112 require.Equal(t, codes.ResourceExhausted, status.Code(grpcErr))
113
114 // HTTP
115 httpClient := otlptracehttp.NewClient(
116 otlptracehttp.WithEndpoint(h.Services[util.ServiceDistributor].Endpoint(4318)),
117 otlptracehttp.WithInsecure(),
118 otlptracehttp.WithRetry(otlptracehttp.RetryConfig{Enabled: false}),
119 )
120 require.NoError(t, httpClient.Start(context.Background()))
121
122 httpErr := httpClient.UploadTraces(context.Background(), protoSpans)
123 assert.Error(t, httpErr)
124 require.Contains(t, httpErr.Error(), "retry-able request failure")
125 })
126}
127
128func TestOTLPLimitsVanillaClient(t *testing.T) {
129 util.RunIntegrationTests(t, util.TestHarnessConfig{

Callers

nothing calls this directly

Calls 5

MakeProtoSpansFunction · 0.92
WaitTracesWritableMethod · 0.80
StartMethod · 0.65
ErrorMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected