Skip to content

Commit

Permalink
allow ingester and distributor to run on same instance (#4348)
Browse files Browse the repository at this point in the history
* allow ingester and distributor to run on same instance

Signed-off-by: Trevor Whitney <trevorjwhitney@gmail.com>

* add comment around conditional distributor Push registration

Co-authored-by: Ed Welch <edward.welch@grafana.com>

* lint

Co-authored-by: Ed Welch <edward.welch@grafana.com>
  • Loading branch information
trevorwhitney and slim-bean authored Sep 17, 2021
1 parent 36e8198 commit 12253ec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/loki/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ func (t *Loki) initDistributor() (services.Service, error) {
return nil, err
}

if !t.Cfg.isModuleEnabled(All) {
// Register the distributor to receive Push requests over GRPC
// EXCEPT when running with `-target=all` or `-target=` contains `ingester`
if !t.Cfg.isModuleEnabled(All) && !t.Cfg.isModuleEnabled(Ingester) {
logproto.RegisterPusherServer(t.Server.GRPC, t.distributor)
}

Expand Down

0 comments on commit 12253ec

Please sign in to comment.