Skip to content

Commit

Permalink
Merge pull request #699 from ansgarwiechers/mongodb_exporter_name_ove…
Browse files Browse the repository at this point in the history
…rrides

mongodb_exporter: make service name and binary path configureable
  • Loading branch information
bastelfreak authored Jan 11, 2024
2 parents 1f043aa + c88de75 commit a158dee
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
9 changes: 9 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6322,6 +6322,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 @@ -6369,6 +6370,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

0 comments on commit a158dee

Please sign in to comment.