Skip to content

argocd-image-updater: ServiceMonitor expects port metrics but Service exposes only https #3595

@r0bj

Description

@r0bj

Describe the bug

ServiceMonitor expects port metrics but Service exposes only https → Prometheus cannot scrape metrics (v1.0.1)

Version

Chart: argocd-image-updater-1.0.1
App version: v1.0.1

Summary

When enabling metrics and ServiceMonitor via Helm values:

metrics:
  enabled: true
  serviceMonitor:
    enabled: true

the chart creates a ServiceMonitor that assumes the Service contains a port named metrics.
However, the Service generated by the same chart exposes only a port named https.

This mismatch causes the Prometheus operator to fail to attach a target, so metrics are not scraped at all.


Actual behavior

Generated ServiceMonitor:

spec:
  endpoints:
    - interval: 30s
      path: /metrics
      port: metrics   # <--- this port name does NOT exist in the Service

Generated Service:

spec:
  ports:
    - name: https      # <--- only this port exists
      port: 8443
      targetPort: metrics

Because the ServiceMonitor references a non-existent port (metrics), Prometheus operator logs a port-not-found error and does not create a scrape target.

This results in completely broken metrics for argocd-image-updater.


Impact

  • No metrics from argocd-image-updater are scraped.
  • Any dashboards/alerts depending on these metrics do not work.
  • Monitoring integrations are effectively broken.

Proposed fix

Option A — fix ServiceMonitor (simplest)

Change port: metricsport: https.

Option B — fix Service

ports:
  - name: metrics
    port: 8443
    targetPort: metrics

Option C — allow configuring ServiceMonitor port name

metrics:
  serviceMonitor:
    portName: https

Related helm chart

argocd-image-updater

Helm chart version

1.0.1

To Reproduce

Steps to reproduce

  1. Install chart argocd-image-updater-1.0.1 with:

    metrics:
      enabled: true
      serviceMonitor:
        enabled: true
  2. Apply the manifests.

  3. Inspect:

    • ServiceMonitor → spec.endpoints[0].port = metrics
    • Service → only port name https
  4. Check Prometheus targets → argocd-image-updater metrics are missing.

  5. Prometheus operator logs port-not-found warning.

Expected behavior

The ServiceMonitor should match the actual Service port name, or the Service should expose a port named metrics.

Either the Service should define:

ports:
  - name: metrics
    port: 8443
    targetPort: metrics

OR

the ServiceMonitor should use port: https.

Screenshots

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions