diff --git a/Documentation/api.md b/Documentation/api.md index 1960f8907..99c60b070 100644 --- a/Documentation/api.md +++ b/Documentation/api.md @@ -2036,21 +2036,6 @@ protocols supported by Prometheus in order of preference (from most to least pre </tr> <tr> <td> -<code>scrapeFallbackProtocol</code><br/> -<em> -<a href="#monitoring.coreos.com/v1.ScrapeProtocol"> -ScrapeProtocol -</a> -</em> -</td> -<td> -<em>(Optional)</em> -<p>The protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type.</p> -<p>It requires Prometheus >= v3.0.0.</p> -</td> -</tr> -<tr> -<td> <code>externalLabels</code><br/> <em> map[string]string @@ -7194,21 +7179,6 @@ protocols supported by Prometheus in order of preference (from most to least pre </tr> <tr> <td> -<code>scrapeFallbackProtocol</code><br/> -<em> -<a href="#monitoring.coreos.com/v1.ScrapeProtocol"> -ScrapeProtocol -</a> -</em> -</td> -<td> -<em>(Optional)</em> -<p>The protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type.</p> -<p>It requires Prometheus >= v3.0.0.</p> -</td> -</tr> -<tr> -<td> <code>externalLabels</code><br/> <em> map[string]string @@ -12054,21 +12024,6 @@ protocols supported by Prometheus in order of preference (from most to least pre </tr> <tr> <td> -<code>scrapeFallbackProtocol</code><br/> -<em> -<a href="#monitoring.coreos.com/v1.ScrapeProtocol"> -ScrapeProtocol -</a> -</em> -</td> -<td> -<em>(Optional)</em> -<p>The protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type.</p> -<p>It requires Prometheus >= v3.0.0.</p> -</td> -</tr> -<tr> -<td> <code>externalLabels</code><br/> <em> map[string]string @@ -18824,21 +18779,6 @@ protocols supported by Prometheus in order of preference (from most to least pre </tr> <tr> <td> -<code>scrapeFallbackProtocol</code><br/> -<em> -<a href="#monitoring.coreos.com/v1.ScrapeProtocol"> -ScrapeProtocol -</a> -</em> -</td> -<td> -<em>(Optional)</em> -<p>The protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type.</p> -<p>It requires Prometheus >= v3.0.0.</p> -</td> -</tr> -<tr> -<td> <code>externalLabels</code><br/> <em> map[string]string @@ -26775,21 +26715,6 @@ protocols supported by Prometheus in order of preference (from most to least pre </tr> <tr> <td> -<code>scrapeFallbackProtocol</code><br/> -<em> -<a href="#monitoring.coreos.com/v1.ScrapeProtocol"> -ScrapeProtocol -</a> -</em> -</td> -<td> -<em>(Optional)</em> -<p>The protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type.</p> -<p>It requires Prometheus >= v3.0.0.</p> -</td> -</tr> -<tr> -<td> <code>externalLabels</code><br/> <em> map[string]string diff --git a/bundle.yaml b/bundle.yaml index 15d5e4896..278ff35dc 100644 --- a/bundle.yaml +++ b/bundle.yaml @@ -27987,18 +27987,6 @@ spec: type: object type: object x-kubernetes-map-type: atomic - scrapeFallbackProtocol: - description: |- - The protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type. - - It requires Prometheus >= v3.0.0. - enum: - - PrometheusProto - - OpenMetricsText0.0.1 - - OpenMetricsText1.0.0 - - PrometheusText0.0.4 - - PrometheusText1.0.0 - type: string scrapeInterval: default: 30s description: |- @@ -40460,18 +40448,6 @@ spec: type: object type: object x-kubernetes-map-type: atomic - scrapeFallbackProtocol: - description: |- - The protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type. - - It requires Prometheus >= v3.0.0. - enum: - - PrometheusProto - - OpenMetricsText0.0.1 - - OpenMetricsText1.0.0 - - PrometheusText0.0.4 - - PrometheusText1.0.0 - type: string scrapeInterval: default: 30s description: |- diff --git a/example/prometheus-operator-crd-full/monitoring.coreos.com_prometheusagents.yaml b/example/prometheus-operator-crd-full/monitoring.coreos.com_prometheusagents.yaml index 0251def61..298d7e38b 100644 --- a/example/prometheus-operator-crd-full/monitoring.coreos.com_prometheusagents.yaml +++ b/example/prometheus-operator-crd-full/monitoring.coreos.com_prometheusagents.yaml @@ -6854,18 +6854,6 @@ spec: type: object type: object x-kubernetes-map-type: atomic - scrapeFallbackProtocol: - description: |- - The protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type. - - It requires Prometheus >= v3.0.0. - enum: - - PrometheusProto - - OpenMetricsText0.0.1 - - OpenMetricsText1.0.0 - - PrometheusText0.0.4 - - PrometheusText1.0.0 - type: string scrapeInterval: default: 30s description: |- diff --git a/example/prometheus-operator-crd-full/monitoring.coreos.com_prometheuses.yaml b/example/prometheus-operator-crd-full/monitoring.coreos.com_prometheuses.yaml index f84b0e3ba..6c5ccf7f9 100644 --- a/example/prometheus-operator-crd-full/monitoring.coreos.com_prometheuses.yaml +++ b/example/prometheus-operator-crd-full/monitoring.coreos.com_prometheuses.yaml @@ -8562,18 +8562,6 @@ spec: type: object type: object x-kubernetes-map-type: atomic - scrapeFallbackProtocol: - description: |- - The protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type. - - It requires Prometheus >= v3.0.0. - enum: - - PrometheusProto - - OpenMetricsText0.0.1 - - OpenMetricsText1.0.0 - - PrometheusText0.0.4 - - PrometheusText1.0.0 - type: string scrapeInterval: default: 30s description: |- diff --git a/example/prometheus-operator-crd/monitoring.coreos.com_prometheusagents.yaml b/example/prometheus-operator-crd/monitoring.coreos.com_prometheusagents.yaml index e6387cce2..174fe6911 100644 --- a/example/prometheus-operator-crd/monitoring.coreos.com_prometheusagents.yaml +++ b/example/prometheus-operator-crd/monitoring.coreos.com_prometheusagents.yaml @@ -6855,18 +6855,6 @@ spec: type: object type: object x-kubernetes-map-type: atomic - scrapeFallbackProtocol: - description: |- - The protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type. - - It requires Prometheus >= v3.0.0. - enum: - - PrometheusProto - - OpenMetricsText0.0.1 - - OpenMetricsText1.0.0 - - PrometheusText0.0.4 - - PrometheusText1.0.0 - type: string scrapeInterval: default: 30s description: |- diff --git a/example/prometheus-operator-crd/monitoring.coreos.com_prometheuses.yaml b/example/prometheus-operator-crd/monitoring.coreos.com_prometheuses.yaml index 3dd822e4c..65707b7c5 100644 --- a/example/prometheus-operator-crd/monitoring.coreos.com_prometheuses.yaml +++ b/example/prometheus-operator-crd/monitoring.coreos.com_prometheuses.yaml @@ -8563,18 +8563,6 @@ spec: type: object type: object x-kubernetes-map-type: atomic - scrapeFallbackProtocol: - description: |- - The protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type. - - It requires Prometheus >= v3.0.0. - enum: - - PrometheusProto - - OpenMetricsText0.0.1 - - OpenMetricsText1.0.0 - - PrometheusText0.0.4 - - PrometheusText1.0.0 - type: string scrapeInterval: default: 30s description: |- diff --git a/jsonnet/prometheus-operator/prometheusagents-crd.json b/jsonnet/prometheus-operator/prometheusagents-crd.json index 5c907c16e..b1062b482 100644 --- a/jsonnet/prometheus-operator/prometheusagents-crd.json +++ b/jsonnet/prometheus-operator/prometheusagents-crd.json @@ -5863,17 +5863,6 @@ "type": "object", "x-kubernetes-map-type": "atomic" }, - "scrapeFallbackProtocol": { - "description": "The protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type.\n\nIt requires Prometheus >= v3.0.0.", - "enum": [ - "PrometheusProto", - "OpenMetricsText0.0.1", - "OpenMetricsText1.0.0", - "PrometheusText0.0.4", - "PrometheusText1.0.0" - ], - "type": "string" - }, "scrapeInterval": { "default": "30s", "description": "Interval between consecutive scrapes.\n\nDefault: \"30s\"", diff --git a/jsonnet/prometheus-operator/prometheuses-crd.json b/jsonnet/prometheus-operator/prometheuses-crd.json index 3617995aa..00d525fed 100644 --- a/jsonnet/prometheus-operator/prometheuses-crd.json +++ b/jsonnet/prometheus-operator/prometheuses-crd.json @@ -7371,17 +7371,6 @@ "type": "object", "x-kubernetes-map-type": "atomic" }, - "scrapeFallbackProtocol": { - "description": "The protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type.\n\nIt requires Prometheus >= v3.0.0.", - "enum": [ - "PrometheusProto", - "OpenMetricsText0.0.1", - "OpenMetricsText1.0.0", - "PrometheusText0.0.4", - "PrometheusText1.0.0" - ], - "type": "string" - }, "scrapeInterval": { "default": "30s", "description": "Interval between consecutive scrapes.\n\nDefault: \"30s\"", diff --git a/pkg/apis/monitoring/v1/prometheus_types.go b/pkg/apis/monitoring/v1/prometheus_types.go index 5f1cf5b85..9f9d37413 100644 --- a/pkg/apis/monitoring/v1/prometheus_types.go +++ b/pkg/apis/monitoring/v1/prometheus_types.go @@ -311,12 +311,6 @@ type CommonPrometheusFields struct { // +optional ScrapeProtocols []ScrapeProtocol `json:"scrapeProtocols,omitempty"` - // The protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type. - // - // It requires Prometheus >= v3.0.0. - // +optional - ScrapeFallbackProtocol *ScrapeProtocol `json:"scrapeFallbackProtocol,omitempty"` - // The labels to add to any time series or alerts when communicating with // external systems (federation, remote storage, Alertmanager). // Labels defined by `spec.replicaExternalLabelName` and diff --git a/pkg/apis/monitoring/v1/zz_generated.deepcopy.go b/pkg/apis/monitoring/v1/zz_generated.deepcopy.go index 2964cd63b..5bd5e7e5a 100644 --- a/pkg/apis/monitoring/v1/zz_generated.deepcopy.go +++ b/pkg/apis/monitoring/v1/zz_generated.deepcopy.go @@ -756,11 +756,6 @@ func (in *CommonPrometheusFields) DeepCopyInto(out *CommonPrometheusFields) { *out = make([]ScrapeProtocol, len(*in)) copy(*out, *in) } - if in.ScrapeFallbackProtocol != nil { - in, out := &in.ScrapeFallbackProtocol, &out.ScrapeFallbackProtocol - *out = new(ScrapeProtocol) - **out = **in - } if in.ExternalLabels != nil { in, out := &in.ExternalLabels, &out.ExternalLabels *out = make(map[string]string, len(*in)) diff --git a/pkg/client/applyconfiguration/monitoring/v1/commonprometheusfields.go b/pkg/client/applyconfiguration/monitoring/v1/commonprometheusfields.go index e9426e529..8fdd50bd6 100644 --- a/pkg/client/applyconfiguration/monitoring/v1/commonprometheusfields.go +++ b/pkg/client/applyconfiguration/monitoring/v1/commonprometheusfields.go @@ -49,7 +49,6 @@ type CommonPrometheusFieldsApplyConfiguration struct { ScrapeInterval *monitoringv1.Duration `json:"scrapeInterval,omitempty"` ScrapeTimeout *monitoringv1.Duration `json:"scrapeTimeout,omitempty"` ScrapeProtocols []monitoringv1.ScrapeProtocol `json:"scrapeProtocols,omitempty"` - ScrapeFallbackProtocol *monitoringv1.ScrapeProtocol `json:"scrapeFallbackProtocol,omitempty"` ExternalLabels map[string]string `json:"externalLabels,omitempty"` EnableRemoteWriteReceiver *bool `json:"enableRemoteWriteReceiver,omitempty"` EnableOTLPReceiver *bool `json:"enableOTLPReceiver,omitempty"` @@ -313,14 +312,6 @@ func (b *CommonPrometheusFieldsApplyConfiguration) WithScrapeProtocols(values .. return b } -// WithScrapeFallbackProtocol sets the ScrapeFallbackProtocol field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ScrapeFallbackProtocol field is set to the value of the last call. -func (b *CommonPrometheusFieldsApplyConfiguration) WithScrapeFallbackProtocol(value monitoringv1.ScrapeProtocol) *CommonPrometheusFieldsApplyConfiguration { - b.ScrapeFallbackProtocol = &value - return b -} - // WithExternalLabels puts the entries into the ExternalLabels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the ExternalLabels field, diff --git a/pkg/client/applyconfiguration/monitoring/v1/prometheusspec.go b/pkg/client/applyconfiguration/monitoring/v1/prometheusspec.go index aca8ea894..77708e1ab 100644 --- a/pkg/client/applyconfiguration/monitoring/v1/prometheusspec.go +++ b/pkg/client/applyconfiguration/monitoring/v1/prometheusspec.go @@ -245,14 +245,6 @@ func (b *PrometheusSpecApplyConfiguration) WithScrapeProtocols(values ...monitor return b } -// WithScrapeFallbackProtocol sets the ScrapeFallbackProtocol field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ScrapeFallbackProtocol field is set to the value of the last call. -func (b *PrometheusSpecApplyConfiguration) WithScrapeFallbackProtocol(value monitoringv1.ScrapeProtocol) *PrometheusSpecApplyConfiguration { - b.ScrapeFallbackProtocol = &value - return b -} - // WithExternalLabels puts the entries into the ExternalLabels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the ExternalLabels field, diff --git a/pkg/client/applyconfiguration/monitoring/v1alpha1/prometheusagentspec.go b/pkg/client/applyconfiguration/monitoring/v1alpha1/prometheusagentspec.go index c0d7a8835..3ee632630 100644 --- a/pkg/client/applyconfiguration/monitoring/v1alpha1/prometheusagentspec.go +++ b/pkg/client/applyconfiguration/monitoring/v1alpha1/prometheusagentspec.go @@ -233,14 +233,6 @@ func (b *PrometheusAgentSpecApplyConfiguration) WithScrapeProtocols(values ...mo return b } -// WithScrapeFallbackProtocol sets the ScrapeFallbackProtocol field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ScrapeFallbackProtocol field is set to the value of the last call. -func (b *PrometheusAgentSpecApplyConfiguration) WithScrapeFallbackProtocol(value monitoringv1.ScrapeProtocol) *PrometheusAgentSpecApplyConfiguration { - b.ScrapeFallbackProtocol = &value - return b -} - // WithExternalLabels puts the entries into the ExternalLabels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the ExternalLabels field, diff --git a/pkg/prometheus/promcfg.go b/pkg/prometheus/promcfg.go index 1a7f39496..9b4696506 100644 --- a/pkg/prometheus/promcfg.go +++ b/pkg/prometheus/promcfg.go @@ -4829,7 +4829,6 @@ func (cg *ConfigGenerator) buildGlobalConfig() yaml.MapSlice { cfg := yaml.MapSlice{} cfg = cg.appendScrapeIntervals(cfg) cfg = cg.addScrapeProtocols(cfg, cg.prom.GetCommonPrometheusFields().ScrapeProtocols) - cfg = cg.addScrapeFallbackProtocol(cfg, cg.prom.GetCommonPrometheusFields().ScrapeFallbackProtocol) cfg = cg.appendExternalLabels(cfg) cfg = cg.appendScrapeLimits(cfg) if cpf.NameValidationScheme != nil { diff --git a/pkg/prometheus/promcfg_test.go b/pkg/prometheus/promcfg_test.go index e997cedfb..3af0000b3 100644 --- a/pkg/prometheus/promcfg_test.go +++ b/pkg/prometheus/promcfg_test.go @@ -125,7 +125,6 @@ func TestGlobalSettings(t *testing.T) { ScrapeInterval monitoringv1.Duration ScrapeTimeout monitoringv1.Duration ScrapeProtocols []monitoringv1.ScrapeProtocol - ScrapeFallbackProtocol *monitoringv1.ScrapeProtocol ExternalLabels map[string]string PrometheusExternalLabelName *string ReplicaExternalLabelName *string @@ -265,22 +264,6 @@ func TestGlobalSettings(t *testing.T) { }, Golden: "valid_global_config_with_unsupported_scrape_protocols.golden", }, - { - Scenario: "valid global config with scrape fallback protocol", - Version: "v3.0.0-rc.0", - ScrapeInterval: "30s", - EvaluationInterval: "30s", - ScrapeFallbackProtocol: ptr.To(monitoringv1.PrometheusText1_0_0), - Golden: "valid_global_config_with_scrape_fallback_protocol.golden", - }, - { - Scenario: "valid global config scrape protocols with unsupported version", - Version: "v2.55.0", - ScrapeInterval: "30s", - EvaluationInterval: "30s", - ScrapeFallbackProtocol: ptr.To(monitoringv1.PrometheusProto), - Golden: "valid_global_config_with_unsupported_scrape_fallback_protocols.golden", - }, { Scenario: "valid global config without rule query offset if prometheus version less required", Version: "v2.52.0", @@ -309,7 +292,6 @@ func TestGlobalSettings(t *testing.T) { ScrapeInterval: tc.ScrapeInterval, ScrapeTimeout: tc.ScrapeTimeout, ScrapeProtocols: tc.ScrapeProtocols, - ScrapeFallbackProtocol: tc.ScrapeFallbackProtocol, ExternalLabels: tc.ExternalLabels, PrometheusExternalLabelName: tc.PrometheusExternalLabelName, ReplicaExternalLabelName: tc.ReplicaExternalLabelName, diff --git a/pkg/prometheus/testdata/valid_global_config_with_scrape_fallback_protocol.golden b/pkg/prometheus/testdata/valid_global_config_with_scrape_fallback_protocol.golden deleted file mode 100644 index 9a6959035..000000000 --- a/pkg/prometheus/testdata/valid_global_config_with_scrape_fallback_protocol.golden +++ /dev/null @@ -1,8 +0,0 @@ -global: - scrape_interval: 30s - fallback_scrape_protocol: PrometheusText1.0.0 - external_labels: - prometheus: test/example - prometheus_replica: $(POD_NAME) - evaluation_interval: 30s -scrape_configs: [] diff --git a/pkg/prometheus/testdata/valid_global_config_with_unsupported_scrape_fallback_protocols.golden b/pkg/prometheus/testdata/valid_global_config_with_unsupported_scrape_fallback_protocols.golden deleted file mode 100644 index 14f383870..000000000 --- a/pkg/prometheus/testdata/valid_global_config_with_unsupported_scrape_fallback_protocols.golden +++ /dev/null @@ -1,7 +0,0 @@ -global: - scrape_interval: 30s - external_labels: - prometheus: test/example - prometheus_replica: $(POD_NAME) - evaluation_interval: 30s -scrape_configs: []