puppet-prometheus icon indicating copy to clipboard operation
puppet-prometheus copied to clipboard

Support scrape_config_files option

Open willfurnell opened this issue 1 year ago • 3 comments

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 https://github.com/prometheus/prometheus/pull/12019 https://github.com/prometheus/prometheus/issues/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

willfurnell avatar Feb 19 '24 16:02 willfurnell

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.

reini-1 avatar Feb 27 '24 12:02 reini-1

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

TheMeier avatar Feb 27 '24 19:02 TheMeier

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

lukebigum avatar Jul 11 '24 11:07 lukebigum

Hi there!

As far as I know there has been no release since #782 has been merged, hence this parameter is still not available, at least if you use the module from the Puppet Forge. Merge occured on July 11, but last release of this module (0.15.0) is from June 13.

If a new release could be done, we could mark this issue as done! For now, I'll simply get the module from the master branch.

Thanks in advance for anyone that can look into this !

redat00 avatar Dec 25 '24 14:12 redat00

@redat00 I try to make a release soon.

TheMeier avatar Dec 30 '24 08:12 TheMeier

closed by #782

TheMeier avatar Dec 30 '24 12:12 TheMeier