Files
grafana/pkg/server/distributor.go
Will Assis dc79e6f3dc unified-storage: fix auth handling in distributor (#106062)
* disable auth handling in the distributor
2025-06-26 12:32:59 -04:00

34 lines
918 B
Go

package server
import (
"context"
"github.com/grafana/dskit/services"
"github.com/grafana/grafana/pkg/modules"
"github.com/grafana/grafana/pkg/services/grpcserver"
"github.com/grafana/grafana/pkg/storage/unified/resource"
"go.opentelemetry.io/otel"
)
func (ms *ModuleServer) initDistributor() (services.Service, error) {
var (
distributor = &distributorService{}
tracer = otel.Tracer("unified-storage-distributor")
err error
)
distributor.grpcHandler, err = resource.ProvideDistributorServer(ms.cfg, ms.features, ms.registerer, tracer, ms.storageRing, ms.storageRingClientPool)
if err != nil {
return nil, err
}
return services.NewBasicService(nil, distributor.running, nil).WithName(modules.Distributor), nil
}
type distributorService struct {
grpcHandler grpcserver.Provider
}
func (d *distributorService) running(ctx context.Context) error {
return d.grpcHandler.Run(ctx)
}