Skip to content

scrapeFallbackProtocol in PrometheusSpec is broken #7196

@hamishforbes

Description

@hamishforbes

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Description

The scrapeFallbackProtocol field in PrometheusSpec is invalid, this is not a global configuration parameter as per https://prometheus.io/docs/prometheus/latest/configuration/configuration/

It's only valid on scrape_config.

This might be better as part of the ScrapeClass spec, then you can create a default scrape class that sets this value everywhere!

Alternatively the current field needs to affect every generated scrape job rather than go into the global config

Steps to Reproduce

Set spec.scrapeFallbackProtocol to anything in a Prometheus resource.

Expected Result

Valid Prometheus config yaml is created

Actual Result

Prometheus (v3.0.1) reports an error reloading configuration

time=2024-12-16T01:29:12.923Z level=ERROR source=main.go:1162 msg="Error reloading config" err="couldn't load configuration (--config.file=\"/etc/prometheus/config_out/prometheus.env.yaml\"): parsing YAML file /etc/prometheus/config_out/prometheus.env.yaml: yaml: unmarshal errors:\n  line 3: field fallback_scrape_protocol not found in type config.plain"

Prometheus Operator Version

0.79.0

Kubernetes Version

1.31.2

Kubernetes Cluster Type

EKS

How did you deploy Prometheus-Operator?

helm chart:prometheus-community/kube-prometheus-stack

Manifests

No response

prometheus-operator log output

N/A

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions