Skip to content

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

Description

@yash97

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions