aws/amazon-vpc-cni-k8s

Helm: podMonitor.scrapeTimeout is defined in values.yaml but never used in the PodMonitor template

Ouverte

#3 803 ouverte le 25 juil. 2026

 (1 commentaire) (0 réaction) (0 personne assignée)Go (823 forks)auto 404
good first issue

Métriques du dépôt

Stars
 (2 450 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

Description

What happened

The aws-vpc-cni Helm chart defines podMonitor.scrapeTimeout in values.yaml, but the PodMonitor template never references it. As a result, a user who sets podMonitor.scrapeTimeout has their value silently ignored — the rendered PodMonitor has no scrapeTimeout field, so Prometheus falls back to its own default.

charts/aws-vpc-cni/values.yaml (defines the value):

podMonitor:
  # The interval to scrape metrics.
  interval: 30s
  # The timeout before a metrics scrape fails.
  scrapeTimeout: 30s

charts/aws-vpc-cni/templates/podmonitor.yaml (uses interval but not scrapeTimeout):

  podMetricsEndpoints:
  - interval: {{ .Values.podMonitor.interval }}
    path: /metrics
    port: metrics
  {{- if .Values.nodeAgent.enabled }}
  - interval: {{ .Values.podMonitor.interval }}
    path: /metrics
    port: agentmetrics
  {{- end }}

Expected behavior

Setting podMonitor.scrapeTimeout should propagate into each podMetricsEndpoints entry of the generated PodMonitor, so operators can bound how long Prometheus waits before marking a scrape of the CNI metrics endpoints as failed.

Proposed fix

Add scrapeTimeout to both endpoints (the metrics port and the agentmetrics port):

  podMetricsEndpoints:
  - interval: {{ .Values.podMonitor.interval }}
    scrapeTimeout: {{ .Values.podMonitor.scrapeTimeout }}
    path: /metrics
    port: metrics
  {{- if .Values.nodeAgent.enabled }}
  - interval: {{ .Values.podMonitor.interval }}
    scrapeTimeout: {{ .Values.podMonitor.scrapeTimeout }}
    path: /metrics
    port: agentmetrics
  {{- end }}

Value of fixing

  • Makes a documented, already-shipped configuration knob actually take effect instead of being silently dropped.
  • Lets users tune scrape timeouts for the CNI metrics endpoints (useful on busy nodes where a scrape can take longer than the Prometheus default), avoiding spurious scrape failures/gaps in metrics.
  • Small, self-contained, well-scoped change — good for a first-time contributor.

Affected file

charts/aws-vpc-cni/templates/podmonitor.yaml (value is defined in charts/aws-vpc-cni/values.yaml). Present on master.

Guide contributeur