Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[prometheus-blackbox-exporter] Duplicate endpoints in self ServiceMonitor when config-reloader is enabled #5321

Open
sebhoss opened this issue Feb 15, 2025 · 0 comments · May be fixed by #5322
Labels
bug Something isn't working

Comments

@sebhoss
Copy link

sebhoss commented Feb 15, 2025

Describe the bug a clear and concise description of what the bug is.

When both configReloader.enabled and serviceMonitor.selfMonitor.enabled is set to true, the following ServiceMonitor is generated:

apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: daemon-prometheus-blackbox-exporter
  namespace: blackbox-exporter
  labels:
    helm.sh/chart: prometheus-blackbox-exporter-9.2.0
    app.kubernetes.io/name: prometheus-blackbox-exporter
    app.kubernetes.io/instance: daemon
    app.kubernetes.io/version: v0.25.0
    app.kubernetes.io/managed-by: Helm
spec:
  endpoints:
    - path: /metrics
      interval: 30s
      scrapeTimeout: 30s
      scheme: http
    - path: /metrics
      interval: 30s
      scrapeTimeout: 30s
      scheme: http
  jobLabel: daemon
  selector:
    matchLabels:
      app.kubernetes.io/name: prometheus-blackbox-exporter
      app.kubernetes.io/instance: daemon
  namespaceSelector:
    matchNames:
      - blackbox-exporter

I think the intention here is to scrape the /metrics path of the config-reloader. We can improve this a little by setting serviceMonitor.selfMonitor.port to http so that the first endpoint in the service monitor scrapes the correct port of the service it is referencing. However we cannot specify the port of the second endpoint and I think the helm-chart should default to working out-of-the-box, e.g. by setting serviceMonitor.selfMonitor.port to http and something like configReloader.serviceMonitor.selfMonitor.port to reloader-web.

What's your helm version?

version.BuildInfo{Version:"v3.17.0", GitCommit:"301108edc7ac2a8ba79e4ebf5701b0b6ce6a31e4", GitTreeState:"clean", GoVersion:"go1.23.4"}

What's your kubectl version?

Client Version: v1.32.1 Kustomize Version: v5.5.0 Server Version: v1.31.4

Which chart?

prometheus-blackbox-exporter

What's the chart version?

9.2.0

What happened?

The chart generated duplicated endpoints, both of which are missing the port information

What you expected to happen?

The chart should generate endpoints correctly matching those exposed by the associated service

How to reproduce it?

Render chart with the below values.yaml settings and look at the generated ServiceMonitor resource

Enter the changed values of values.yaml?

configReloader:
  enabled: true
serviceMonitor:
  selfMonitor:
    enabled: true

Enter the command that you execute and failing/misfunctioning.

helm template ...

Anything else we need to know?

No response

@sebhoss sebhoss added the bug Something isn't working label Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant