diff --git a/pkg/ingester/ingester.go b/pkg/ingester/ingester.go index 1f0e438848..b7959dff9f 100644 --- a/pkg/ingester/ingester.go +++ b/pkg/ingester/ingester.go @@ -206,7 +206,7 @@ type Config struct { UpdateIngesterOwnedSeries bool `yaml:"track_ingester_owned_series" category:"experimental"` OwnedSeriesUpdateInterval time.Duration `yaml:"owned_series_update_interval" category:"experimental"` - EnablePushAPI bool `yaml:"enable_push_api" category:"experimental" doc:"hidden"` + PushGrpcMethodEnabled bool `yaml:"push_grpc_method_enabled" category:"experimental" doc:"hidden"` // This config is dynamically injected because defined outside the ingester config. IngestStorageConfig ingest.Config `yaml:"-"` @@ -232,8 +232,7 @@ func (cfg *Config) RegisterFlags(f *flag.FlagSet, logger log.Logger) { f.BoolVar(&cfg.UseIngesterOwnedSeriesForLimits, "ingester.use-ingester-owned-series-for-limits", false, "When enabled, only series currently owned by ingester according to the ring are used when checking user per-tenant series limit.") f.BoolVar(&cfg.UpdateIngesterOwnedSeries, "ingester.track-ingester-owned-series", false, "This option enables tracking of ingester-owned series based on ring state, even if -ingester.use-ingester-owned-series-for-limits is disabled.") f.DurationVar(&cfg.OwnedSeriesUpdateInterval, "ingester.owned-series-update-interval", 15*time.Second, "How often to check for ring changes and possibly recompute owned series as a result of detected change.") - - f.BoolVar(&cfg.EnablePushAPI, "ingester.enable-push-api", true, "When disabled, disallows Push API in ingester. Use after migrating ingester to ingest-storage.") + f.BoolVar(&cfg.PushGrpcMethodEnabled, "ingester.push-grpc-method-enabled", true, "Enables Push gRPC method on ingester. Can be only disabled when using ingest-storage to make sure ingesters only receive data from Kafka.") // The ingester.return-only-grpc-errors flag has been deprecated. // According to the migration plan (https://github.com/grafana/mimir/issues/6008#issuecomment-1854320098) @@ -3502,7 +3501,7 @@ func (i *Ingester) PushToStorage(ctx context.Context, req *mimirpb.WriteRequest) // Push implements client.IngesterServer func (i *Ingester) Push(ctx context.Context, req *mimirpb.WriteRequest) (*mimirpb.WriteResponse, error) { - if !i.cfg.EnablePushAPI { + if !i.cfg.PushGrpcMethodEnabled { return nil, errPushAPIDisabled } diff --git a/pkg/ingester/ingester_ingest_storage_test.go b/pkg/ingester/ingester_ingest_storage_test.go index 2095e2ccfa..a7824fac49 100644 --- a/pkg/ingester/ingester_ingest_storage_test.go +++ b/pkg/ingester/ingester_ingest_storage_test.go @@ -382,7 +382,7 @@ func createTestIngesterWithIngestStorage(t testing.TB, ingesterCfg *Config, over defaultIngesterConfig := defaultIngesterTestConfig(t) // Always disable gRPC Push API when testing ingest store. - ingesterCfg.EnablePushAPI = false + ingesterCfg.PushGrpcMethodEnabled = false ingesterCfg.IngestStorageConfig.Enabled = true ingesterCfg.IngestStorageConfig.KafkaConfig.Topic = "mimir" diff --git a/pkg/ingester/ingester_test.go b/pkg/ingester/ingester_test.go index 3139993e59..ab8f20e7bd 100644 --- a/pkg/ingester/ingester_test.go +++ b/pkg/ingester/ingester_test.go @@ -6748,9 +6748,9 @@ func TestIngester_PushInstanceLimitsWithCircuitBreaker_LimitInflightRequestsUsin } } -func TestIngester_PushAPIDisabled(t *testing.T) { +func TestIngester_PushGrpcMethod_Disabled(t *testing.T) { cfg := defaultIngesterTestConfig(t) - cfg.EnablePushAPI = false + cfg.PushGrpcMethodEnabled = false registry := prometheus.NewRegistry() diff --git a/pkg/mimir/mimir.go b/pkg/mimir/mimir.go index 561118822b..bb7bd6965b 100644 --- a/pkg/mimir/mimir.go +++ b/pkg/mimir/mimir.go @@ -244,8 +244,8 @@ func (c *Config) Validate(log log.Logger) error { if c.IngestStorage.Enabled && !c.Ingester.DeprecatedReturnOnlyGRPCErrors { return errors.New("to use ingest storage (-ingest-storage.enabled) also enable -ingester.return-only-grpc-errors") } - if !c.IngestStorage.Enabled && !c.Ingester.EnablePushAPI { - return errors.New("cannot disable Push API in ingester, while ingest storage (-ingest-storage.enabled) is also disabled") + if !c.IngestStorage.Enabled && !c.Ingester.PushGrpcMethodEnabled { + return errors.New("cannot disable Push gRPC method in ingester, while ingest storage (-ingest-storage.enabled) is not enabled") } } if err := c.BlocksStorage.Validate(c.Ingester.ActiveSeriesMetrics); err != nil { diff --git a/pkg/mimir/mimir_test.go b/pkg/mimir/mimir_test.go index c66c87bee8..7ff85d2c99 100644 --- a/pkg/mimir/mimir_test.go +++ b/pkg/mimir/mimir_test.go @@ -453,7 +453,7 @@ func TestConfigValidation(t *testing.T) { getTestConfig: func() *Config { cfg := newDefaultConfig() _ = cfg.Target.Set("ingester") - cfg.Ingester.EnablePushAPI = false + cfg.Ingester.PushGrpcMethodEnabled = false cfg.IngestStorage.Enabled = false return cfg