sensu-plugins-dcos 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 72e507ad43fb1065b853a85b712d06ae861442e3
4
- data.tar.gz: 8c559824697de4eb48e860fc0a92708d4d3c0392
3
+ metadata.gz: f5bef184b73bafd43bf11d77eeb36805130a8fe3
4
+ data.tar.gz: 9b20f2a650dbd83d4171dd4366affecf4fdede07
5
5
  SHA512:
6
- metadata.gz: 958266b51628e79e1a34aed90cd901c260874f4cbeb6cffc81927212c8733ea030efc7d17389ba5b29d57c5bbd12d62fdae13384265dad4d0f1a68cb76bbf9a2
7
- data.tar.gz: 9f56d654e5fdce81cf3fc84d576d5b67aab842579367b02a9962dc4118e875255dbaf689f2e44448046168ef0fcc52bcf9a4c28ec51c4baef0c15a9a824b9179
6
+ metadata.gz: 589059efd1c7f0adba27cdef8fe214a36a63a7654195f2531945c10e34164df1fe71174efbe3680a1dc1f739c854b07919baf75cbea1a5ccc86f7ed65b855e6f
7
+ data.tar.gz: 2635d39d94065930f64017e5435573b4015b949bb72279a639f7840b9bdfa2c263f42cc503e67f8a4506dd0e6ebfb8279be5b9df66087e37a3b1b8b2cf1ffca5
data/CHANGELOG.md CHANGED
@@ -6,6 +6,11 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.4.0] - 2017-10-20
10
+ ### Added
11
+ - todo item is added: metrics-dcos-containers.rb Add dimentions to the metric name framework_name, framework_role, executor_id (@1fox1)
12
+ - added dimensions argument, argument takes a comma seperated list of the dimensions you wish to output (@1fox1)
13
+
9
14
  ## [0.3.0] - 2017-09-19
10
15
  ### Added
11
16
  - started re-testing all supported ruby versions again (@majormoses)
@@ -60,7 +65,8 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
60
65
  ### Added
61
66
  - Initial release
62
67
 
63
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-dcos/compare/0.3.0...HEAD
68
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-dcos/compare/0.4.0...HEAD
69
+ [0.4.0]: https://github.com/sensu-plugins/sensu-plugins-dcos/compare/0.3.0...0.4.0
64
70
  [0.3.0]: https://github.com/sensu-plugins/sensu-plugins-dcos/compare/0.2.1...0.3.0
65
71
  [0.2.1]: https://github.com/sensu-plugins/sensu-plugins-dcos/compare/0.1.1...0.2.1
66
72
  [0.1.1]: https://github.com/sensu-plugins/sensu-plugins-dcos/compare/0.1.0...0.1.1
data/README.md CHANGED
@@ -9,12 +9,16 @@
9
9
  ## Functionality
10
10
 
11
11
  ## Files
12
- * bin/check-dcos-metrics.rb
13
- * check-dcos-container-metrics.rb
12
+ * bin/check-dcos-component-health.rb
14
13
  * bin/check-dcos-container-count.rb
14
+ * bin/check-dcos-container-metrics.rb
15
+ * bin/check-dcos-jobs-health.rb
15
16
  * bin/check-dcos-metrics.rb
17
+ * bin/check-dcos-node-health.rb
16
18
  * bin/check-dcos-ping.rb
17
- * bin/check-dcos-component-health.rb
19
+ * bin/metrics-dcos-containers.rb
20
+ * bin/metrics-dcos-host.rb
21
+ * bin/metrics-dcos-system-health.rb
18
22
 
19
23
  ## Usage
20
24
 
@@ -59,6 +63,9 @@ This is an example how to use this plugin to ship metrics to InfluxDB using the
59
63
  }
60
64
  ```
61
65
 
66
+ metrics-dcos-containers.rb can be used in the same way to ship container metrics (from frameworks not apps) specify a comma seperated list of the dimensions you require in the oupput to the --dimensions flag. example metrics-dcos-containers.rb --dimensions 'framework_name,excutor_id'
67
+
68
+
62
69
  ### Host Health Check
63
70
 
64
71
  The `check-dcos-ping.rb` will return `OK` if the host reports itself as heathy or `CRITICAL` otherwize
@@ -39,8 +39,6 @@
39
39
  # See the License for the specific language governing permissions and
40
40
  # limitations under the License.
41
41
  #
42
- # TODO:
43
- # Add dimentions to the metric name (framework_name; framework_role, executor_id)
44
42
 
45
43
  require 'sensu-plugin/metric/cli'
46
44
  require 'json'
@@ -77,16 +75,28 @@ class DCOSMetrics < Sensu::Plugin::Metric::CLI::Graphite
77
75
  long: '--uri URI',
78
76
  default: '/system/v1/metrics/v0/containers'
79
77
 
78
+ option :dimensions,
79
+ description: 'comma seperated list of dimensions to add into the output',
80
+ short: '-d DIMENSIONS',
81
+ long: '--dimensions DIMENSIONS',
82
+ required: false
83
+
80
84
  def run
81
85
  containers = get_data("http://#{config[:server]}:#{config[:port]}#{config[:uri]}")
82
- unless containers.nil? || containers.empty? # rubocop:desable Style/MultilineIfModifier
83
- containers.each do |container|
86
+ unless containers.nil? || containers.empty?
87
+ containers.each do |container| # rubocop:disable Metrics/BlockLength
84
88
  all_metrics = get_data("http://#{config[:server]}:#{config[:port]}#{config[:uri]}/#{container}")
89
+ if config[:dimensions]
90
+ extra_tags = []
91
+ config[:dimensions].tr(' ', '').split(',').each do |d|
92
+ extra_tags.push(all_metrics['dimensions'][d]) if all_metrics['dimensions'][d]
93
+ end
94
+ end
85
95
  if all_metrics.key?('datapoints')
86
96
  all_metrics['datapoints'].each do |metric|
87
97
  metric['name'].tr!('/', '.')
88
98
  metric['name'].squeeze!('.')
89
- output([config[:scheme], container, metric['unit'], metric['name']].join('.'), metric['value'])
99
+ output([config[:scheme], extra_tags, container, metric['unit'], metric['name']].compact.join('.'), metric['value'])
90
100
  end
91
101
  end
92
102
  app_metrics = get_data("http://#{config[:server]}:#{config[:port]}#{config[:uri]}/#{container}/app")
@@ -100,7 +110,7 @@ class DCOSMetrics < Sensu::Plugin::Metric::CLI::Graphite
100
110
  metric['name'].tr!('/', '.')
101
111
  metric['name'].squeeze!('.')
102
112
  metric['unit'] = 'na' if metric['unit'].empty?
103
- output([config[:scheme], container, 'app', metric['unit'], metric['name']].join('.'), metric['value'])
113
+ output([config[:scheme], extra_tags, container, 'app', metric['unit'], metric['name']].compact.join('.'), metric['value'])
104
114
  end
105
115
  end
106
116
  end
@@ -3,7 +3,7 @@
3
3
  module SensuPluginsDcos
4
4
  module Version
5
5
  MAJOR = 0
6
- MINOR = 3
6
+ MINOR = 4
7
7
  PATCH = 0
8
8
 
9
9
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-dcos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - PTC and contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-19 00:00:00.000000000 Z
11
+ date: 2017-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin
@@ -328,7 +328,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
328
328
  version: '0'
329
329
  requirements: []
330
330
  rubyforge_project:
331
- rubygems_version: 2.6.13
331
+ rubygems_version: 2.6.14
332
332
  signing_key:
333
333
  specification_version: 4
334
334
  summary: Sensu plugins for dcos-metrics checks and metrics