@@ -84,6 +84,11 @@ type bootstrapParameters struct {
8484 // PrometheusCompressionLibrary defines the HTTP compression library for metrics endpoint for prometheus.
8585 // TODO: remove this field because it is not used.
8686 PrometheusCompressionLibrary string
87+ // PrometheusCompressionChooseFirst defines whether to choose first encoding type for metrics endpoint for prometheus.
88+ PrometheusCompressionChooseFirst bool
89+ // PrometheusCompressionRemoveAcceptEncodingHeader defines whether to remove the
90+ // Accept-Encoding header from the request before forwarding it to the upstream for metrics endpoint for prometheus.
91+ PrometheusCompressionRemoveAcceptEncodingHeader bool
8792
8893 // OtelMetricSinks defines the configuration of the OpenTelemetry sinks.
8994 OtelMetricSinks []metricSink
@@ -177,11 +182,13 @@ func (b *bootstrapConfig) render() error {
177182// GetRenderedBootstrapConfig renders the bootstrap YAML string
178183func GetRenderedBootstrapConfig (opts * RenderBootstrapConfigOptions ) (string , error ) {
179184 var (
180- enablePrometheus = true
181- enablePrometheusCompression = false
182- prometheusCompressionLibrary = "Gzip"
183- metricSinks []metricSink
184- StatsMatcher StatsMatcherParameters
185+ enablePrometheus = true
186+ enablePrometheusCompression = false
187+ prometheusCompressionLibrary = "Gzip"
188+ prometheusCompressionChooseFirst = false
189+ prometheusCompressionRemoveAcceptEncodingHeader = false
190+ metricSinks []metricSink
191+ StatsMatcher StatsMatcherParameters
185192 )
186193
187194 if opts != nil && opts .ProxyMetrics != nil {
@@ -193,6 +200,8 @@ func GetRenderedBootstrapConfig(opts *RenderBootstrapConfigOptions) (string, err
193200 if proxyMetrics .Prometheus .Compression != nil {
194201 enablePrometheusCompression = true
195202 prometheusCompressionLibrary = string (proxyMetrics .Prometheus .Compression .Type )
203+ prometheusCompressionChooseFirst = proxyMetrics .Prometheus .Compression .ChooseFirst
204+ prometheusCompressionRemoveAcceptEncodingHeader = proxyMetrics .Prometheus .Compression .RemoveAcceptEncodingHeader
196205 }
197206 }
198207
@@ -263,14 +272,16 @@ func GetRenderedBootstrapConfig(opts *RenderBootstrapConfigOptions) (string, err
263272 Address : netutils .IPv4ListenerAddress ,
264273 Port : EnvoyStatsPort ,
265274 },
266- SdsCertificatePath : defaultSdsCertificatePath ,
267- SdsTrustedCAPath : defaultSdsTrustedCAPath ,
268- EnablePrometheus : enablePrometheus ,
269- EnablePrometheusCompression : enablePrometheusCompression ,
270- PrometheusCompressionLibrary : prometheusCompressionLibrary ,
271- OtelMetricSinks : metricSinks ,
272- ServiceClusterName : defaultServiceClusterName ,
273- ServiceAccountTokenPath : defaultServiceAccountTokenPath ,
275+ SdsCertificatePath : defaultSdsCertificatePath ,
276+ SdsTrustedCAPath : defaultSdsTrustedCAPath ,
277+ EnablePrometheus : enablePrometheus ,
278+ EnablePrometheusCompression : enablePrometheusCompression ,
279+ PrometheusCompressionLibrary : prometheusCompressionLibrary ,
280+ PrometheusCompressionChooseFirst : prometheusCompressionChooseFirst ,
281+ PrometheusCompressionRemoveAcceptEncodingHeader : prometheusCompressionRemoveAcceptEncodingHeader ,
282+ OtelMetricSinks : metricSinks ,
283+ ServiceClusterName : defaultServiceClusterName ,
284+ ServiceAccountTokenPath : defaultServiceAccountTokenPath ,
274285 },
275286 }
276287
0 commit comments