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

Apache Exporter 0.8.0+ uses -- as argument prefix #442

Closed
krische opened this issue Apr 13, 2020 · 1 comment · Fixed by #444
Closed

Apache Exporter 0.8.0+ uses -- as argument prefix #442

krische opened this issue Apr 13, 2020 · 1 comment · Fixed by #444

Comments

@krische
Copy link

krische commented Apr 13, 2020

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: N/A
  • Ruby: N/A
  • Distribution: N/A
  • Module version: 8.3.0

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

class { 'prometheus::apache_exporter':
  version: '0.8.0',
}

What are you seeing

It looks like version 0.8.0 of Apache Exporter now uses -- as the argument prefix instead of -. Specifying the scrape URI with -scrape_uri will result in an error apache_exporter: error: unknown short flag '-s', try --help.

What behaviour did you expect instead

The prometheus::apache_exporter should use a version comparison to determine if needs -- or -. For example:

if versioncmp($version, '0.8.0') < 0 {
  $options = "-scrape_uri \"${scrape_uri}\" ${extra_options}"
} else {
  $options = "--scrape_uri \"${scrape_uri}\" ${extra_options}"
}

Output log

Any additional information you'd like to impart

@bastelfreak
Copy link
Member

@krische thanks for raising the issue. could you provide a patch for 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
2 participants