Prometheus: replace default scrapeConfigs to fix duplicate scrape job
What does this MR do?
The bundled Prometheus subchart (29.17.0) renders scrape configs from two
additive sources: its own populated scrapeConfigs map (~10 default jobs)
and GitLab's legacy serverFiles."prometheus.yml".scrape_configs. GitLab
attempted to suppress the upstream defaults with scrapeConfigs: null, but
null is silently dropped when coalescing into the condition-gated
(prometheus.install) subchart (helm/helm#31446, helm/helm#9136), so the
upstream defaults survived and collided with GitLab's own jobs, causing
Prometheus to fail to load with found multiple scrape configs with job name "prometheus".
Replace the ineffective null with an empty list, scrapeConfigs: []. A
non-null value propagates through the condition-gated coalesce, and a
list-typed value replaces the upstream default map wholesale (list-vs-map
type mismatch), leaving only GitLab's own serverFiles jobs. Rendering now
emits exactly the 5 GitLab jobs, each once, with no duplicates, no
placeholder job, and no Helm coalesce warning.
Interim fix; it relies on Helm's list-replaces-map coalesce behavior. The
durable fix (migrating GitLab's jobs onto the upstream scrapeConfigs
structure) is tracked in #6413.
Related issues
Author checklist
For general guidance, please follow our Contributing guide.
Required
For anything in this list which will not be completed, please provide a reason in the MR discussion.
- Merge Request Title and Description are up to date, accurate, and descriptive.
- MR targeting the appropriate branch.
- MR has a green pipeline.
- Documentation created/updated.
- Tests added/updated.
- Have you validated that your change works end-to-end on a real cluster deployment?
- Describe how you did it in a comment.
- Equivalent MR/issue for omnibus-gitlab opened.
Reviewers checklist
- MR has a green pipeline on https://gitlab.com/gitlab-org/charts/gitlab.
- Consider downstream impact to the Operator, as per evaluating impact from changes to GitLab chart.