@@ -4,8 +4,10 @@ import (
44 "connectrpc.com/connect"
55
66 connectapi "github.com/grafana/pyroscope/pkg/api/connect"
7+ "github.com/grafana/pyroscope/pkg/tenant"
78 "github.com/grafana/pyroscope/pkg/util"
89 "github.com/grafana/pyroscope/pkg/util/delayhandler"
10+ "github.com/grafana/pyroscope/pkg/validation"
911)
1012
1113func connectInterceptorRecovery () connect.HandlerOption {
@@ -32,8 +34,15 @@ func (a *API) connectOptionsAuthRecovery() []connect.HandlerOption {
3234 return append (connectapi .DefaultHandlerOptions (), a .connectInterceptorAuth (), connectInterceptorRecovery ())
3335}
3436
35- func (a * API ) connectOptionsAuthDelayRecovery (limits delayhandler.Limits ) []connect.HandlerOption {
36- return append (connectapi .DefaultHandlerOptions (), a .connectInterceptorAuth (), a .connectInterceptorDelay (limits ), connectInterceptorRecovery ())
37+ func (a * API ) connectOptionsAuthDelayRecovery (limits * validation.Overrides ) []connect.HandlerOption {
38+ // no per tenant overrides implemented for connect requests
39+ messageLimit := int (limits .IngestionBodyLimitBytes (tenant .DefaultTenantID ))
40+ return append (connectapi .DefaultHandlerOptions (),
41+ a .connectInterceptorAuth (),
42+ connect .WithReadMaxBytes (messageLimit ),
43+ a .connectInterceptorDelay (limits ),
44+ connectInterceptorRecovery (),
45+ )
3746}
3847
3948func (a * API ) connectOptionsAuthLogRecovery () []connect.HandlerOption {
0 commit comments