newrelic-rmq-plugin 0.1.7 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +7 -6
- data/.rubocop.yml +3 -0
- data/CHANGELOG.md +13 -0
- data/Gemfile.lock +7 -6
- data/README.md +19 -0
- data/lib/newrelic-rmq-plugin.rb +0 -2
- data/lib/newrelic-rmq-plugin/agent.rb +1 -3
- data/lib/newrelic-rmq-plugin/cli.rb +1 -1
- data/lib/newrelic-rmq-plugin/helpers/configuration.rb +2 -2
- data/lib/newrelic-rmq-plugin/util.rb +2 -10
- data/lib/newrelic-rmq-plugin/version.rb +1 -1
- data/newrelic-rmq-plugin.gemspec +4 -4
- metadata +13 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ce859e37dfa5874c12ff212a127042487ebc170
|
4
|
+
data.tar.gz: c1c2254397cfe657657ba6bebbda3b2513b85bfd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72c4c06c76f516db5fdabc514971d0885cfb193b333b7a276e256eb3d23178aa35cb247beac46e78fcd12d1e806f8ca6d44d4de4dd5a6b534f4d6b24fea475ce
|
7
|
+
data.tar.gz: 618567245127b601f51c6c7dd9d99cea567e39c101b8a969a6a78ad0ae20c5b252b20d9dc724832f4457cf70a2cf64bea454087d6f921fd45e19ac3766db0c67
|
data/.gitlab-ci.yml
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
before_script:
|
2
2
|
- ruby -v
|
3
3
|
- which ruby
|
4
|
-
- gem install bundler --no-
|
4
|
+
- gem install bundler --no-document
|
5
5
|
- bundle install --jobs $(nproc) --path vendor/bundle
|
6
6
|
|
7
|
-
test:Ruby 2.
|
8
|
-
image: ruby:2.
|
7
|
+
test:Ruby 2.4:
|
8
|
+
image: ruby:2.4
|
9
9
|
cache:
|
10
10
|
paths:
|
11
11
|
- .bundle
|
@@ -17,15 +17,16 @@ test:Ruby 2.3:
|
|
17
17
|
except:
|
18
18
|
- tags
|
19
19
|
|
20
|
-
release:Ruby 2.
|
21
|
-
image: ruby:2.
|
20
|
+
release:Ruby 2.4:
|
21
|
+
image: ruby:2.4
|
22
22
|
cache:
|
23
23
|
paths:
|
24
24
|
- .bundle
|
25
25
|
- vendor/bundle
|
26
26
|
script:
|
27
|
+
- gem install dpl --no-document
|
27
28
|
- bundle exec rubocop
|
28
|
-
-
|
29
|
+
- dpl --provider=rubygems --api-key=$RUBYGEMS_API_KEY
|
29
30
|
artifacts:
|
30
31
|
name: "newrelic-rmq-plugin-$CI_BUILD_REF_NAME"
|
31
32
|
paths:
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,19 @@ NewRelic-RabbitMQ-Plugin Changelog
|
|
2
2
|
=========================
|
3
3
|
This file is used to list changes made in each version of the `newrelic-rmq-plugin` gem.
|
4
4
|
|
5
|
+
|
6
|
+
v0.1.11 (2017-04-25)
|
7
|
+
-------------------
|
8
|
+
- Automated RubyGems deployment from CI
|
9
|
+
|
10
|
+
v0.1.8 (2017-04-25)
|
11
|
+
-------------------
|
12
|
+
- Remove erroneous dependencies
|
13
|
+
|
14
|
+
v0.1.7 (2017-03-17)
|
15
|
+
-------------------
|
16
|
+
- Add ability to detect cluster issues
|
17
|
+
|
5
18
|
v0.1.6 (2016-11-28)
|
6
19
|
-------------------
|
7
20
|
- Break Queue Size Totals out so that we can use the 'Stacked Area' Chart Type
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
newrelic-rmq-plugin (0.1.
|
4
|
+
newrelic-rmq-plugin (0.1.8)
|
5
5
|
mixlib-cli (~> 1.7)
|
6
6
|
newrelic_plugin
|
7
7
|
rabbitmq_manager (~> 0.3.0)
|
@@ -11,11 +11,11 @@ GEM
|
|
11
11
|
specs:
|
12
12
|
ast (2.3.0)
|
13
13
|
diff-lcs (1.3)
|
14
|
-
faraday (0.
|
14
|
+
faraday (0.12.1)
|
15
15
|
multipart-post (>= 1.2, < 3)
|
16
16
|
faraday_middleware (0.11.0.1)
|
17
17
|
faraday (>= 0.7.4, < 1.0)
|
18
|
-
json (2.0
|
18
|
+
json (2.1.0)
|
19
19
|
mixlib-cli (1.7.0)
|
20
20
|
multipart-post (2.0.0)
|
21
21
|
newrelic_plugin (1.3.1)
|
@@ -26,7 +26,8 @@ GEM
|
|
26
26
|
rabbitmq_manager (0.3.0)
|
27
27
|
faraday
|
28
28
|
faraday_middleware
|
29
|
-
rainbow (2.2.
|
29
|
+
rainbow (2.2.2)
|
30
|
+
rake
|
30
31
|
rake (10.5.0)
|
31
32
|
rspec (3.5.0)
|
32
33
|
rspec-core (~> 3.5.0)
|
@@ -41,14 +42,14 @@ GEM
|
|
41
42
|
diff-lcs (>= 1.2.0, < 2.0)
|
42
43
|
rspec-support (~> 3.5.0)
|
43
44
|
rspec-support (3.5.0)
|
44
|
-
rubocop (0.
|
45
|
+
rubocop (0.48.1)
|
45
46
|
parser (>= 2.3.3.1, < 3.0)
|
46
47
|
powerpack (~> 0.1)
|
47
48
|
rainbow (>= 1.99.1, < 3.0)
|
48
49
|
ruby-progressbar (~> 1.7)
|
49
50
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
50
51
|
ruby-progressbar (1.8.1)
|
51
|
-
unicode-display_width (1.1
|
52
|
+
unicode-display_width (1.2.1)
|
52
53
|
|
53
54
|
PLATFORMS
|
54
55
|
ruby
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# newrelic-rmq-plugin
|
2
2
|
* NewRelic RabbitMQ Plugin Agent
|
3
3
|
* Polls RabbitMQ for Metrics & Ships to NewRelic
|
4
|
+
* Monitors for Cluster Partitions & Stopped Nodes
|
4
5
|
|
5
6
|
## Background
|
6
7
|
This is based primarily off of the [RedBubble NewRelic RabbitMQ Agent](https://github.com/redbubble/newrelic-rabbitmq-agent)
|
@@ -9,6 +10,24 @@ The idea was to package this is a gem for simplified deployment, and add/adjust
|
|
9
10
|
## Running as a Service
|
10
11
|
You'll likely want to run this as a service, `SystemD` or `Upstart` will likely be your friend in this regard.
|
11
12
|
|
13
|
+
#### Upstart Example
|
14
|
+
```bash
|
15
|
+
description 'NewRelic RabbitMQ Agent'
|
16
|
+
start on started network-interface INTERFACE!=lo
|
17
|
+
stop on runlevel [!2345]
|
18
|
+
|
19
|
+
setuid nobody
|
20
|
+
setgid nogroup
|
21
|
+
|
22
|
+
respawn
|
23
|
+
respawn limit 5 2
|
24
|
+
|
25
|
+
script
|
26
|
+
exec newrelic-rmq-plugin --nr-cfg-file /etc/newrelic/rabbitmq.yml
|
27
|
+
end script
|
28
|
+
```
|
29
|
+
|
30
|
+
|
12
31
|
## Security
|
13
32
|
You should lock down permissions on all configuration files in this project to only the user which this runs as...
|
14
33
|
|
data/lib/newrelic-rmq-plugin.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Encoding: UTF-8
|
2
|
-
# rubocop: disable LineLength
|
2
|
+
# rubocop: disable LineLength, Lint/AmbiguousBlockAssociation
|
3
3
|
#
|
4
4
|
# Gem Name:: newrelic-rmq-plugin
|
5
5
|
# NewRelicRMQPlugin:: Agent
|
@@ -9,8 +9,6 @@
|
|
9
9
|
# All rights reserved - Do Not Redistribute
|
10
10
|
#
|
11
11
|
|
12
|
-
require 'rubygems'
|
13
|
-
require 'bundler/setup'
|
14
12
|
require 'newrelic_plugin'
|
15
13
|
require 'rabbitmq_manager'
|
16
14
|
require 'uri'
|
@@ -41,7 +41,7 @@ module NewRelicRMQPlugin
|
|
41
41
|
cli.parse_options(argv)
|
42
42
|
|
43
43
|
# => Parse JSON Config File (If Specified and Exists)
|
44
|
-
json_config = Util.
|
44
|
+
json_config = Util.parse_json(cli.config[:config_file] || Config.config_file)
|
45
45
|
|
46
46
|
# => Grab the Default Values
|
47
47
|
default = Config.options
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Encoding: UTF-8
|
2
2
|
#
|
3
|
-
# Gem Name::
|
3
|
+
# Gem Name:: newrelic-rmq-plugin
|
4
4
|
# Helper:: Configuration
|
5
5
|
#
|
6
6
|
# Author: Eli Fatsi - https://www.viget.com/articles/easy-gem-configuration-variables-with-defaults
|
@@ -12,7 +12,7 @@ module Configuration
|
|
12
12
|
#
|
13
13
|
# => Provides a method to configure an Application
|
14
14
|
# => Example:
|
15
|
-
#
|
15
|
+
# NewRelicRMQPlugin::Config.setup do |cfg|
|
16
16
|
# cfg.config_file = 'abc.json'
|
17
17
|
# cfg.app_name = 'GemBase'
|
18
18
|
# end
|
@@ -21,7 +21,7 @@ module NewRelicRMQPlugin
|
|
21
21
|
########################
|
22
22
|
|
23
23
|
# => Define JSON Parser
|
24
|
-
def
|
24
|
+
def parse_json(file = nil, symbolize = true)
|
25
25
|
return unless file && ::File.exist?(file.to_s)
|
26
26
|
begin
|
27
27
|
::JSON.parse(::File.read(file.to_s), symbolize_names: symbolize)
|
@@ -31,7 +31,7 @@ module NewRelicRMQPlugin
|
|
31
31
|
end
|
32
32
|
|
33
33
|
# => Define JSON Writer
|
34
|
-
def
|
34
|
+
def write_json(file, object)
|
35
35
|
return unless file && object
|
36
36
|
begin
|
37
37
|
File.open(file, 'w') { |f| f.write(JSON.pretty_generate(object)) }
|
@@ -59,13 +59,5 @@ module NewRelicRMQPlugin
|
|
59
59
|
return unless csv && csv.is_a?(String)
|
60
60
|
csv.split(',')
|
61
61
|
end
|
62
|
-
|
63
|
-
def serialize_revisions(branches, tags)
|
64
|
-
# => Serialize Branches/Tags into JSON Array
|
65
|
-
# => Branches = String, Tags = Key/Value
|
66
|
-
branches = branches.map(&:name).sort_by(&:downcase)
|
67
|
-
tags = tags.map(&:name).sort_by(&:downcase).reverse.map { |tag| { name: "Tag: #{tag}", value: tag } }
|
68
|
-
JSON.pretty_generate(branches + tags)
|
69
|
-
end
|
70
62
|
end
|
71
63
|
end
|
data/newrelic-rmq-plugin.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
|
18
18
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
19
19
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
20
|
-
if spec.respond_to?(:metadata)
|
20
|
+
if spec.respond_to?(:metadata) # rubocop: disable Style/GuardClause
|
21
21
|
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
22
22
|
else
|
23
23
|
raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
|
@@ -29,13 +29,13 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.require_paths = ['lib']
|
30
30
|
|
31
31
|
# => Dependencies
|
32
|
-
spec.add_runtime_dependency 'newrelic_plugin'
|
33
|
-
spec.add_runtime_dependency 'rabbitmq_manager', '~> 0.3
|
32
|
+
spec.add_runtime_dependency 'newrelic_plugin', '~> 1.3'
|
33
|
+
spec.add_runtime_dependency 'rabbitmq_manager', '~> 0.3'
|
34
34
|
spec.add_runtime_dependency 'mixlib-cli', '~> 1.7'
|
35
35
|
|
36
36
|
# => Development Dependencies
|
37
37
|
spec.add_development_dependency 'bundler', '~> 1.12'
|
38
38
|
spec.add_development_dependency 'rake', '~> 10.0'
|
39
39
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
40
|
-
spec.add_development_dependency 'rubocop'
|
40
|
+
spec.add_development_dependency 'rubocop', '~> 0.48'
|
41
41
|
end
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: newrelic-rmq-plugin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Dwyer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: newrelic_plugin
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '1.3'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rabbitmq_manager
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.3
|
33
|
+
version: '0.3'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.3
|
40
|
+
version: '0.3'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: mixlib-cli
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,16 +98,16 @@ dependencies:
|
|
98
98
|
name: rubocop
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
103
|
+
version: '0.48'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - "
|
108
|
+
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
110
|
+
version: '0.48'
|
111
111
|
description:
|
112
112
|
email:
|
113
113
|
- bdwyer@IEEE.org
|
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
158
|
version: '0'
|
159
159
|
requirements: []
|
160
160
|
rubyforge_project:
|
161
|
-
rubygems_version: 2.6.
|
161
|
+
rubygems_version: 2.6.11
|
162
162
|
signing_key:
|
163
163
|
specification_version: 4
|
164
164
|
summary: NewRelic RabbitMQ Plugin
|