Skip to content

Commit

Permalink
chore(block-scheduler): add scheduler grpc methods to auth mw ignore …
Browse files Browse the repository at this point in the history
…list (#15388)
  • Loading branch information
ashwanthgoli authored Dec 13, 2024
1 parent 6dfe90a commit b353acf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
14 changes: 13 additions & 1 deletion pkg/blockbuilder/types/grpc_transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import (

"github.com/grafana/dskit/grpcclient"
"github.com/grafana/dskit/instrument"
"github.com/grafana/dskit/middleware"
otgrpc "github.com/opentracing-contrib/go-grpc"
"github.com/opentracing/opentracing-go"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
Expand Down Expand Up @@ -47,7 +50,16 @@ func NewGRPCTransportFromAddress(
cfg grpcclient.Config,
reg prometheus.Registerer,
) (*GRPCTransport, error) {
dialOpts, err := cfg.DialOption(grpcclient.Instrument(newGRPCTransportMetrics(reg).requestLatency))
metrics := newGRPCTransportMetrics(reg)
dialOpts, err := cfg.DialOption(
[]grpc.UnaryClientInterceptor{
otgrpc.OpenTracingClientInterceptor(opentracing.GlobalTracer()),
middleware.UnaryClientInstrumentInterceptor(metrics.requestLatency),
}, []grpc.StreamClientInterceptor{
otgrpc.OpenTracingStreamClientInterceptor(opentracing.GlobalTracer()),
middleware.StreamClientInstrumentInterceptor(metrics.requestLatency),
},
)
if err != nil {
return nil, err
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/loki/loki.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,9 @@ func (t *Loki) setupAuthMiddleware() {
"/schedulerpb.SchedulerForFrontend/FrontendLoop",
"/schedulerpb.SchedulerForQuerier/QuerierLoop",
"/schedulerpb.SchedulerForQuerier/NotifyQuerierShutdown",
"/blockbuilder.types.SchedulerService/GetJob",
"/blockbuilder.types.SchedulerService/CompleteJob",
"/blockbuilder.types.SchedulerService/SyncJob",
})
}

Expand Down

0 comments on commit b353acf

Please sign in to comment.