diff --git a/pkg/loki/loki.go b/pkg/loki/loki.go index 7ddff964a0873..0757edfc0f9d7 100644 --- a/pkg/loki/loki.go +++ b/pkg/loki/loki.go @@ -418,7 +418,11 @@ func (t *Loki) setupModuleManager() error { Compactor: {Server, Overrides}, IndexGateway: {Server}, IngesterQuerier: {Ring}, - All: {QueryFrontend, Querier, Ingester, Distributor, TableManager, Ruler}, + + // Virtual Targets + All: {QueryFrontend, Querier, Ingester, Distributor, TableManager, Ruler}, + Read: {QueryFrontend, QueryScheduler, Querier, Ruler}, + Write: {Ingester, Distributor}, } // Add IngesterQuerier as a dependency for store when target is either ingester or querier. diff --git a/pkg/loki/modules.go b/pkg/loki/modules.go index fd9a6fb712db6..5761de49a4c7c 100644 --- a/pkg/loki/modules.go +++ b/pkg/loki/modules.go @@ -78,7 +78,11 @@ const ( Compactor string = "compactor" IndexGateway string = "index-gateway" QueryScheduler string = "query-scheduler" - All string = "all" + + // Virtual Targets + All string = "all" + Read string = "read" + Write string = "write" ) func (t *Loki) initServer() (services.Service, error) { @@ -209,7 +213,7 @@ func (t *Loki) initQuerier() (services.Service, error) { QuerySchedulerEnabled: t.Cfg.isModuleEnabled(QueryScheduler), } - var queryHandlers = map[string]http.Handler{ + queryHandlers := map[string]http.Handler{ "/loki/api/v1/query_range": http.HandlerFunc(t.Querier.RangeQueryHandler), "/loki/api/v1/query": http.HandlerFunc(t.Querier.InstantQueryHandler), "/loki/api/v1/label": http.HandlerFunc(t.Querier.LabelHandler),