Previously we had Puppet server 5.3.11 with "puppet-prometheus" module version 10.2.0. We are doing upgrade to Puppet 8 and used latest version of "puppet-prometheus" module version -> 14.0.0
What we have seen is that after puppet agent applied changes (against Puppet 8), systemd service was not running and giving error:
level=error msg="Error loading config (--config.file=/etc/prometheus/prometheus.yaml)" file=/etc/prometheus/prometheus.yaml err="parsing YAML file /etc/prometheus/prometheus.yaml: found multiple scrape configs with job name \"prometheus\""
What we did is opened our puppet-control-repo, searched there and found only 1 occurrence. But when we opened file /etc/prometheus/prometheus.yaml we saw that there are actually two "job_name: prometheus" - one is the one that we define and the second one is of unknown origin.
When we commented unknown "job_name: prometheus" and started prometheus systemd service - all worked good, no errors etc.
So for now what we did is added "chattr +i /etc/prometheus/prometheus.yaml" as temp workaround.
But i'm curios why this unknown "job_name: prometheus" appeared. When we run puppet agent it wants to do next change:
UPD: checked code and found that module has "$include_default_scrape_configs" i've set it to "false" and now all is good. i guess i was too quick creating GitHub issue :-)
Affected Puppet, Ruby, OS and module versions/distributions
How to reproduce (e.g Puppet code you use)
content of Puppetfile
content of "data/roles/prometheus.yaml"
content of "site/profile/manifests/prometheus.pp"
What are you seeing
Previously we had Puppet server 5.3.11 with "puppet-prometheus" module version 10.2.0. We are doing upgrade to Puppet 8 and used latest version of "puppet-prometheus" module version -> 14.0.0
What we have seen is that after puppet agent applied changes (against Puppet 8), systemd service was not running and giving error:
What we did is opened our puppet-control-repo, searched there and found only 1 occurrence. But when we opened file /etc/prometheus/prometheus.yaml we saw that there are actually two "job_name: prometheus" - one is the one that we define and the second one is of unknown origin.
When we commented unknown "job_name: prometheus" and started prometheus systemd service - all worked good, no errors etc.
So for now what we did is added "chattr +i /etc/prometheus/prometheus.yaml" as temp workaround.
But i'm curios why this unknown "job_name: prometheus" appeared. When we run puppet agent it wants to do next change:
What behavior did you expect instead
No unknown "job_name: prometheus" duplicate should appear
Output log
Any additional information you'd like to impart