sensu-plugins / sensu-plugins-mongodb

This plugin provides native MongoDB instrumentation for monitoring and metrics collection, including: service health, database connectivity, replication lag/status, `oplog` monitoring, collection-specific metrics, and more.

Home Page:http://sensu-plugins.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Check metrics-mongodb.rb crashed after Sensu upgrade

mdzidic opened this issue · comments

Hello,

After upgrading Sensu client to latest version (currently 1.0.2) check metrics-mongodb.rb throws this error:

/opt/sensu/embedded/lib/ruby/site_ruby/2.4.0/rubygems/specification.rb:2288:in `raise_if_conflicts': Unable to activate sensu-plugins-mongodb-1.4.0, because sensu-plugin-2.3.0 conflicts with sensu-plugin (~> 1.2) (Gem::ConflictError)

I had to remove sensu-plugin gem v2.3.0 and v2.0.1, as it only works with v1.4.5>

Any idea how to fix this?

We should bump the dependency here on sensu-plugin to 2.x and release like this: sensu-plugins/sensu-plugins-aws@a4b1619

This is something we need to do with almost all the plugins...Any chance you would be willing to create a PR for this?

To be clear this is not technically a bug, it is just not compatible yet with the sensu-plugin 2.x library which is included by default in sensu 1.x setups. Unfortunately I checked and did not see anything in the sensu changelog specifying that this was changed and should be called out as a breaking change like we do on plugins...

Any chance you could spend some time putting together a PR?

Hello @majormoses
Tell me how to fix version as I have two options.

bin/metrics-mongodb.rb
Add line:
gem 'sensu-plugin', '<= 1.4.5'

or /sensu-plugins-mongodb.gemspec
change
s.add_runtime_dependency 'sensu-plugin', '~> 1.2'
to
s.add_runtime_dependency 'sensu-plugin', '~< 1.4.5'

well we should figure out the go forward path with updating s.add_runtime_dependency 'sensu-plugin', '~> 2.0' this may require other changes in order to work but that is the starting point.

@mdzidic can you try validating if using that PR solves your problems? I don't have the time to figure out all the check/metric options but I can do some testing if you can give me the options you would use.

Hello,

Now I have same problem with latest metrics-mongodb.rb plugin but different sensu-plugin version.

/opt/sensu/embedded/lib/ruby/site_ruby/2.4.0/rubygems/specification.rb:2288:in `raise_if_conflicts': Unable to activate sensu-plugins-mongodb-2.0.2, because sensu-plugin-3.0.0 conflicts with sensu-plugin (~> 2.0) (Gem::ConflictError)
	from /opt/sensu/embedded/lib/ruby/site_ruby/2.4.0/rubygems/specification.rb:1408:in `activate'
	from /opt/sensu/embedded/lib/ruby/site_ruby/2.4.0/rubygems.rb:220:in `rescue in try_activate'
	from /opt/sensu/embedded/lib/ruby/site_ruby/2.4.0/rubygems.rb:213:in `try_activate'
	from /opt/sensu/embedded/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:126:in `rescue in require'
	from /opt/sensu/embedded/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:39:in `require'
	from /etc/sensu/plugins/metrics-mongodb.rb:32:in `<main>'

@mdzidic are you pinning your versions? There are very few plugins that have been updated to support the 3.x release of sensu-plugins library. We follow semver and all breaking changes are made in major versions. This means that you can pin your versions and only pull in when all your plugins have been updated to support the breaking changes. If you want to open a Pull request to update it (see reference PR for the ~> 2.0 bump) otherwise I will get to it when I have the time.

@mdzidic are you pinning your versions? There are very few plugins that have been updated to support the 3.x release of sensu-plugins library. We follow semver and all breaking changes are made in major versions. This means that you can pin your versions and only pull in when all your plugins have been updated to support the breaking changes. If you want to open a Pull request to update it (see reference PR for the ~> 2.0 bump) otherwise I will get to it when I have the time.

Yes, I pin version but also I update Sensu client and plugins to latest version from time to time.
Okay, I'll go with pull request for ~> 3.0, thanks!