From 888e4012bcfcb3389ef95fdc825931fbd3448e0f Mon Sep 17 00:00:00 2001 From: Trevor Whitney Date: Mon, 9 Jun 2025 11:06:12 -0600 Subject: [PATCH] chore: clean up pattern persistence configs (#18017) --- docs/sources/shared/configuration.md | 15 +++++++-------- pkg/pattern/pattern_config.go | 7 ------- pkg/validation/limits.go | 9 ++++++++- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/docs/sources/shared/configuration.md b/docs/sources/shared/configuration.md index 783491f20f..5da0c7a5b7 100644 --- a/docs/sources/shared/configuration.md +++ b/docs/sources/shared/configuration.md @@ -662,10 +662,6 @@ pattern_ingester: # Configures how detected patterns are pushed back to Loki for persistence. pattern_persistence: - # Whether pattern persistence is enabled. - # CLI flag: -pattern-ingester.pattern-persistence.enabled - [enabled: | default = false] - # The address of the Loki instance to push patterns to. # CLI flag: -pattern-ingester.pattern-persistence.loki-address [loki_address: | default = ""] @@ -4346,13 +4342,16 @@ otlp_config: # List of LogQL vector and range aggregations that should be sharded. [shard_aggregations: ] -# Enable metric and pattern aggregation. When enabled, pushed streams will be -# sampled for bytes, line count, and patterns. These metrics will be written -# back into Loki as a special __aggregated_metric__ stream. +# Enable metric aggregation. When enabled, pushed streams will be sampled for +# bytes and line counts. These metrics will be written back into Loki as a +# special __aggregated_metric__ stream. # CLI flag: -limits.aggregation-enabled [metric_aggregation_enabled: | default = false] -[pattern_persistence_enabled: ] +# Enable persistence of patterns detected at ingest. When enabled, patterns for +# pushed streams will be written back into Loki as a special __pattern__ stream. +# CLI flag: -limits.pattern-persistence-enabled +[pattern_persistence_enabled: | default = false] # S3 server-side encryption type. Required to enable server-side encryption # overrides for a specific tenant. If not set, the default S3 client settings diff --git a/pkg/pattern/pattern_config.go b/pkg/pattern/pattern_config.go index 8547677d16..223fe73988 100644 --- a/pkg/pattern/pattern_config.go +++ b/pkg/pattern/pattern_config.go @@ -10,7 +10,6 @@ import ( // PersistenceConfig contains the configuration for pushing detected patterns back to Loki type PersistenceConfig struct { - Enabled bool `yaml:"enabled,omitempty" doc:"description=Whether pattern persistence is enabled."` LokiAddr string `yaml:"loki_address,omitempty" doc:"description=The address of the Loki instance to push patterns to."` WriteTimeout time.Duration `yaml:"timeout,omitempty" doc:"description=The timeout for writing patterns to Loki."` PushPeriod time.Duration `yaml:"push_period,omitempty" doc:"description=How long to wait between pattern pushes to Loki."` @@ -27,12 +26,6 @@ func (cfg *PersistenceConfig) RegisterFlags(fs *flag.FlagSet) { } func (cfg *PersistenceConfig) RegisterFlagsWithPrefix(fs *flag.FlagSet, prefix string) { - fs.BoolVar( - &cfg.Enabled, - prefix+"enabled", - false, - "Enable pushing detected patterns back to Loki for persistence.", - ) fs.StringVar( &cfg.LokiAddr, prefix+"loki-address", diff --git a/pkg/validation/limits.go b/pkg/validation/limits.go index 29ba06e987..a63b523c26 100644 --- a/pkg/validation/limits.go +++ b/pkg/validation/limits.go @@ -468,8 +468,15 @@ func (l *Limits) RegisterFlags(f *flag.FlagSet) { &l.MetricAggregationEnabled, "limits.aggregation-enabled", false, - "Enable metric and pattern aggregation. When enabled, pushed streams will be sampled for bytes, line count, and patterns. These metrics will be written back into Loki as a special __aggregated_metric__ stream.", + "Enable metric aggregation. When enabled, pushed streams will be sampled for bytes and line counts. These metrics will be written back into Loki as a special __aggregated_metric__ stream.", ) + f.BoolVar( + &l.PatternPersistenceEnabled, + "limits.pattern-persistence-enabled", + false, + "Enable persistence of patterns detected at ingest. When enabled, patterns for pushed streams will be written back into Loki as a special __pattern__ stream.", + ) + f.DurationVar(&l.SimulatedPushLatency, "limits.simulated-push-latency", 0, "Simulated latency to add to push requests. This is used to test the performance of the write path under different latency conditions.") f.BoolVar(