Is there an existing issue for this?
What happened?
Description
When deploying a Probe resource with a non-legacy label name (e.g. cluster-id), the generated configuration will crash on Prometheus without UTF-8 support (< v3.0.0).
Steps to Reproduce
- Deploy a Prometheus with image
quay.io/prometheus/prometheus:v2.45.0
- Deploy this Probe manifest
apiVersion: monitoring.coreos.com/v1
kind: Probe
metadata:
name: probe-test
spec:
interval: 30s
module: http_2xx
prober:
path: /probe
url: blackbox-exporter:9115
targets:
staticConfig:
labels:
cluster-id: xxx
static:
- https://example.com
Expected Result
No crash :)
Actual Result
$ kc logs prometheus-prometheus-0 -c prometheus
ts=2025-09-11T09:10:28.271Z caller=main.go:482 level=error msg="Error loading config (--config.file=/etc/prometheus/config_out/prometheus.env.yaml)" file=/etc/prometheus/config_out/prometheus.env.yaml err="parsing YAML file /etc/prometheus/config_out/prometheus.env.yaml: \"cluster-id\" is not a valid label name"
Prometheus Operator Version
Kubernetes Version
Kubernetes Cluster Type
kind
How did you deploy Prometheus-Operator?
yaml manifests
Manifests
prometheus-operator log output
Anything else?
Related to #7362
Note that the issue doesn't manifest when using a Prometheus version >= 3 because utf-8 support is always enabled.
Is there an existing issue for this?
What happened?
Description
When deploying a Probe resource with a non-legacy label name (e.g.
cluster-id), the generated configuration will crash on Prometheus without UTF-8 support (< v3.0.0).Steps to Reproduce
quay.io/prometheus/prometheus:v2.45.0Expected Result
No crash :)
Actual Result
Prometheus Operator Version
Kubernetes Version
N/AKubernetes Cluster Type
kind
How did you deploy Prometheus-Operator?
yaml manifests
Manifests
prometheus-operator log output
Anything else?
Related to #7362
Note that the issue doesn't manifest when using a Prometheus version >= 3 because utf-8 support is always enabled.