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

Support scrape_config_files option #711

Open
willfurnell opened this issue Feb 19, 2024 · 3 comments
Open

Support scrape_config_files option #711

willfurnell opened this issue Feb 19, 2024 · 3 comments

Comments

@willfurnell
Copy link

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 7.28.0
  • Ruby: ruby 2.0.0p648
  • Distribution: CentOS 7 server, Rocky 9 client
  • Module version: 13.4.0

How to reproduce (e.g Puppet code you use)

class profile::prometheus_server {
  class { 'prometheus::server':
    scrape_config_files => '/etc/prometheus/scrape_configs/*.yml',
  }
}

What are you seeing

I cannot use the new config option scrape_config_files added by this issue/PR prometheus/prometheus#12019 prometheus/prometheus#8543. It was added in Prometheus version 2.43.0

What behaviour did you expect instead

To be able to use this config option.

Output log

root@prometheus ~]# puppet agent -t -E prometheus
Info: Using environment 'prometheus'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Notice: Requesting catalog from server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Class[Prometheus::Server]: has no parameter named 'scrape_config_files' (file: /etc/puppetlabs/code/environments/prometheus/site-modules/profile/manifests/init.pp, line: 717, column: 3) on node prometheus
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

Any additional information you'd like to impart

@reini-1
Copy link

reini-1 commented Feb 27, 2024

It would be nice if this is supported by the module.
As workaround you can add a custom config template. I copied the original (modules/prometheus/templates/prometheus.yaml.erb) and added the line 'scrape_config_files'=>['/etc/prometheus/scrape-config.d/*.yaml', '/etc/prometheus/scrape-config.d/*.yml'] and
called class prometheus::server with config_template => 'path/to/new/template', but a default and more flexible way would be nice.

@TheMeier
Copy link
Contributor

@willfurnell, @reini-1 interested in providing a pull request to implement this?

@lukebigum
Copy link
Contributor

I didn't see this issue. #782 tries to implement this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants