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

mongodb_exporter: make service name and binary path configureable #699

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6224,6 +6224,7 @@ The following parameters are available in the `prometheus::mongodb_exporter` cla

* [`arch`](#-prometheus--mongodb_exporter--arch)
* [`bin_dir`](#-prometheus--mongodb_exporter--bin_dir)
* [`bin_name`](#-prometheus--mongodb_exporter--bin_name)
* [`cnf_uri`](#-prometheus--mongodb_exporter--cnf_uri)
* [`download_extension`](#-prometheus--mongodb_exporter--download_extension)
* [`download_url`](#-prometheus--mongodb_exporter--download_url)
Expand Down Expand Up @@ -6271,6 +6272,14 @@ Directory where binaries are located

Default value: `$prometheus::bin_dir`

##### <a name="-prometheus--mongodb_exporter--bin_name"></a>`bin_name`

Data type: `String[1]`

The name of the binary to execute

Default value: `'mongodb_exporter'`

##### <a name="-prometheus--mongodb_exporter--cnf_uri"></a>`cnf_uri`

Data type: `String[1]`
Expand Down
6 changes: 5 additions & 1 deletion manifests/mongodb_exporter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Architecture (amd64 or i386)
# @param bin_dir
# Directory where binaries are located
# @param bin_name
# The name of the binary to execute
# @param cnf_uri
# The URI to obtain MongoDB stats from
# @param download_extension
Expand Down Expand Up @@ -81,6 +83,7 @@
Optional[Prometheus::Uri] $download_url = undef,
String[1] $arch = $prometheus::real_arch,
Stdlib::Absolutepath $bin_dir = $prometheus::bin_dir,
String[1] $bin_name = 'mongodb_exporter',
Boolean $export_scrape_job = false,
Optional[Stdlib::Host] $scrape_host = undef,
Stdlib::Port $scrape_port = 9216,
Expand Down Expand Up @@ -110,14 +113,15 @@

$options = "${flag_prefix}mongodb.uri=${cnf_uri} ${extra_options}"

prometheus::daemon { 'mongodb_exporter':
prometheus::daemon { $service_name:
install_method => $install_method,
version => $version,
download_extension => $download_extension,
os => $os,
arch => $arch,
real_download_url => $real_download_url,
bin_dir => $bin_dir,
bin_name => $bin_name,
archive_bin_path => $archive_bin_path,
notify_service => $notify_service,
package_name => $package_name,
Expand Down
Loading