Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
MasslessParticle committed Mar 20, 2024
1 parent e957592 commit 4a52139
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/ingester/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func New(cfg Config, addr string) (HealthAndIngesterClient, error) {
func instrumentation(cfg *Config) ([]grpc.UnaryClientInterceptor, []grpc.StreamClientInterceptor) {
var unaryInterceptors []grpc.UnaryClientInterceptor
unaryInterceptors = append(unaryInterceptors, cfg.GRPCUnaryClientInterceptors...)
unaryInterceptors = append(unaryInterceptors, server.ClientQueryTagsInterceptor)
unaryInterceptors = append(unaryInterceptors, server.UnaryClientQueryTagsInterceptor)
unaryInterceptors = append(unaryInterceptors, otgrpc.OpenTracingClientInterceptor(opentracing.GlobalTracer()))
if !cfg.Internal {
unaryInterceptors = append(unaryInterceptors, middleware.ClientUserHeaderInterceptor)
Expand Down
2 changes: 1 addition & 1 deletion pkg/loki/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -1582,7 +1582,7 @@ func (t *Loki) initQueryLimitsInterceptors() (services.Service, error) {
func (t *Loki) initIngesterQueryTagsInterceptors() (services.Service, error) {
_ = level.Debug(util_log.Logger).Log("msg", "initializing ingester query tags interceptors")
t.Cfg.Server.GRPCStreamMiddleware = append(t.Cfg.Server.GRPCStreamMiddleware, serverutil.StreamServerQueryTagsInterceptor)
t.Cfg.Server.GRPCMiddleware = append(t.Cfg.Server.GRPCMiddleware, serverutil.ServerQueryTagsInterceptor)
t.Cfg.Server.GRPCMiddleware = append(t.Cfg.Server.GRPCMiddleware, serverutil.UnaryServerQueryTagsInterceptor)

return nil, nil
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/util/server/grpc_query_tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ func extractFromGRPCRequest(ctx context.Context) context.Context {
return context.WithValue(ctx, httpreq.QueryTagsHTTPHeader, headerValues[0])
}

// ClientQueryTagsInterceptor propagates the query tags from the context to gRPC metadata, which eventually ends up as a HTTP2 header.
// UnaryClientQueryTagsInterceptor propagates the query tags from the context to gRPC metadata, which eventually ends up as a HTTP2 header.
// For unary gRPC requests.
func ClientQueryTagsInterceptor(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
func UnaryClientQueryTagsInterceptor(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
return invoker(injectIntoGRPCRequest(ctx), method, req, reply, cc, opts...)
}

Expand All @@ -58,8 +58,8 @@ func StreamClientQueryTagsInterceptor(ctx context.Context, desc *grpc.StreamDesc
return streamer(injectIntoGRPCRequest(ctx), desc, cc, method, opts...)
}

// ServerQueryTagsInterceptor propagates the query tags from the gRPC metadata back to our context for unary gRPC requests.
func ServerQueryTagsInterceptor(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
// UnaryServerQueryTagsInterceptor propagates the query tags from the gRPC metadata back to our context for unary gRPC requests.
func UnaryServerQueryTagsInterceptor(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
return handler(extractFromGRPCRequest(ctx), req)
}

Expand Down

0 comments on commit 4a52139

Please sign in to comment.