-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
Description
添加全局标签不生效
apiVersion: monitoring.coreos.com/v1
kind: Prometheus
generation: 6
labels:
app.kubernetes.io/component: prometheus
app.kubernetes.io/instance: k8s
app.kubernetes.io/name: prometheus
app.kubernetes.io/part-of: kube-prometheus
app.kubernetes.io/version: 3.5.0
name: k8s
namespace: monitoring
spec:
externalLabels:
origin_prometheus: xxxxxx
- Prometheus Operator version: *
kube-prometheus-0.14.0
kube-prometheus-0.15.0
kube-prometheus-0.16.0
尝试上述版本,都有这个问题。
- Kubernetes version information:
v1.34.3-aliyun.1
v1.34.1-eks-3025e55
- Prometheus Operator Logs:
prometheus time=2026-01-29T09:51:52.525Z level=INFO source=main.go:1497 msg="Loading configuration file" filename=/etc/prometheus/config_out/prometheus.env.yaml
prometheus time=2026-01-29T09:51:52.599Z level=INFO source=main.go:1537 msg="Completed loading of configuration file" db_storage=1.52µs remote_storage=1.42µs web_handler=510ns query_engine=1.09µs scrape=3.620596ms scrape_sd=90.173µs notify=192.857µs notify_sd=9.52µs rules=64.260686ms tracing=5.57µs filename=/etc/prometheus/config_out/prometheus.env.yaml totalDuration=74.214131ms
prometheus time=2026-01-29T09:52:04.243Z level=INFO source=main.go:1497 msg="Loading configuration file" filename=/etc/prometheus/config_out/prometheus.env.yaml
prometheus time=2026-01-29T09:52:04.288Z level=INFO source=main.go:1537 msg="Completed loading of configuration file" db_storage=1.44µs remote_storage=1.42µs web_handler=370ns query_engine=1.041µs scrape=2.228897ms scrape_sd=64.982µs notify=121.954µs notify_sd=7.071µs rules=37.048903ms tracing=5.041µs filename=/etc/prometheus/config_out/prometheus.env.yaml totalDuration=45.02364ms
prometheus time=2026-01-29T09:52:20.177Z level=INFO source=warnings.go:70 msg="v1 Endpoints is deprecated in v1.33+; use discovery.k8s.io/v1 EndpointSlice" component=k8s_client_runtime
prometheus time=2026-01-29T09:55:48.177Z level=INFO source=warnings.go:70 msg="v1 Endpoints is deprecated in v1.33+; use discovery.k8s.io/v1 EndpointSlice" component=k8s_client_runtime
prometheus time=2026-01-29T09:56:02.177Z level=INFO source=warnings.go:70 msg="v1 Endpoints is deprecated in v1.33+; use discovery.k8s.io/v1 EndpointSlice" component=k8s_client_runtime
prometheus time=2026-01-29T09:57:58.177Z level=INFO source=warnings.go:70 msg="v1 Endpoints is deprecated in v1.33+; use discovery.k8s.io/v1 EndpointSlice" component=k8s_client_runtime
prometheus time=2026-01-29T10:00:32.189Z level=INFO source=warnings.go:70 msg="v1 Endpoints is deprecated in v1.33+; use discovery.k8s.io/v1 EndpointSlice" component=k8s_client_runtime
prometheus time=2026-01-29T10:03:25.180Z level=INFO source=warnings.go:70 msg="v1 Endpoints is deprecated in v1.33+; use discovery.k8s.io/v1 EndpointSlice" component=k8s_client_runtime
prometheus time=2026-01-29T10:03:58.178Z level=INFO source=warnings.go:70 msg="v1 Endpoints is deprecated in v1.33+; use discovery.k8s.io/v1 EndpointSlice" component=k8s_client_runtime
prometheus time=2026-01-29T10:04:15.179Z level=INFO source=warnings.go:70 msg="v1 Endpoints is deprecated in v1.33+; use discovery.k8s.io/v1 EndpointSlice" component=k8s_client_runtime
配置文件已经加载了此配置。
/prometheus $ cat /etc/prometheus/config_out/prometheus.env.yaml |grep -C 5 origin_prometheus
global:
scrape_interval: 30s
external_labels:
origin_prometheus: xxxxxx
prometheus: monitoring/k8s
evaluation_interval: 30s
rule_files:
- /etc/prometheus/rules/prometheus-k8s-rulefiles-0/*.yaml
scrape_configs:
Reactions are currently unavailable