sensu-plugins-dcos 0.3.0 → 0.4.0
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/CHANGELOG.md +7 -1
- data/README.md +10 -3
- data/bin/metrics-dcos-containers.rb +16 -6
- data/lib/sensu-plugins-dcos/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5bef184b73bafd43bf11d77eeb36805130a8fe3
|
4
|
+
data.tar.gz: 9b20f2a650dbd83d4171dd4366affecf4fdede07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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-
|
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/
|
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?
|
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
|
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.
|
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-
|
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.
|
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
|