@@ -76,6 +76,10 @@ func init() {
7676 }
7777
7878 for _ , f := range parser .Functions {
79+ // holt_winters is excluded by default; use WithEnableHoltWinters(true) for older backends.
80+ if f .Name == "holt_winters" {
81+ continue
82+ }
7983 // Ignore experimental functions for now.
8084 if ! f .Experimental {
8185 defaultSupportedFuncs = append (defaultSupportedFuncs , f )
@@ -94,6 +98,7 @@ type options struct {
9498 enableOffset bool
9599 enableAtModifier bool
96100 enableVectorMatching bool
101+ enableHoltWinters bool // holt_winters not in Prometheus 3.x; enable for older backends
97102 enableExperimentalPromQLFunctions bool
98103 atModifierMaxTimestamp int64
99104
@@ -119,6 +124,10 @@ func (o *options) applyDefaults() {
119124 o .enabledFuncs = defaultSupportedFuncs
120125 }
121126
127+ if o .enableHoltWinters && parser .Functions ["holt_winters" ] != nil {
128+ o .enabledFuncs = append (o .enabledFuncs , parser .Functions ["holt_winters" ])
129+ }
130+
122131 if o .enableExperimentalPromQLFunctions {
123132 o .enabledAggrs = append (o .enabledAggrs , experimentalPromQLAggrs ... )
124133 o .enabledFuncs = append (o .enabledFuncs , experimentalSupportedFuncs ... )
@@ -168,6 +177,15 @@ func WithEnableVectorMatching(enableVectorMatching bool) Option {
168177 })
169178}
170179
180+ // WithEnableHoltWinters enables generation of holt_winters() in queries.
181+ // Disabled by default because Prometheus 3.x replaced it with double_exponential_smoothing;
182+ // enable only when fuzzing older backends that still support holt_winters.
183+ func WithEnableHoltWinters (enable bool ) Option {
184+ return optionFunc (func (o * options ) {
185+ o .enableHoltWinters = enable
186+ })
187+ }
188+
171189func WithEnableExperimentalPromQLFunctions (enableExperimentalPromQLFunctions bool ) Option {
172190 return optionFunc (func (o * options ) {
173191 o .enableExperimentalPromQLFunctions = enableExperimentalPromQLFunctions
0 commit comments