logstash-input-jmx 0.1.3 → 0.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0b960e6c16e259f4b5f6f399f866d1029d663553
4
- data.tar.gz: d75ef687ae03e0d4f8d5b4bb16d258dc6575b525
3
+ metadata.gz: 67673b34c4e945d059fcaa7e33a03ca2070b1bba
4
+ data.tar.gz: 7f2d0ad1b534e028be342a40576e051fd5d5b55d
5
5
  SHA512:
6
- metadata.gz: 77b9a796e34f408753af49da83c4d67052e8d0c31d585617f64de7d1439a59745e94c62b33adb22dea6728d0416d6a0255cd80817cd3e90850cee63e869cbc54
7
- data.tar.gz: df2348e08eb37b68e59ad88288ea65e483eb0ffb4ba27592388387095633dee87167695809d0243f42c210bb798b76ee2e44d54cbc47841d6a94c15b32900781
6
+ metadata.gz: 1880ae440dbc2769ac3f56a00cea10c256740992663ca0ef86050a715e5ed5838cf29571b0ba576383a1b8292f5a31b674f7a54ca76fc9c259e6de85756c566d
7
+ data.tar.gz: 1680bf84de7847953ad9d98aab0144b60c37b1be82058680c0e045236c96e7ee25b16288320f8e81471668ca7e42582581f61b641d29ef451130118d4ffd497e
data/CONTRIBUTORS CHANGED
@@ -5,6 +5,8 @@ Contributors:
5
5
  * Nicolas Fraison (ashangit)
6
6
  * Pier-Hugues Pellerin (ph)
7
7
  * Richard Pijnenburg (electrical)
8
+ * Pere Urbon-Bayes (purbon)
9
+ * Colin Surprenant (colinsurprenant)
8
10
 
9
11
  Note: If you've sent us patches, bug reports, or otherwise contributed to
10
12
  Logstash, and you aren't on the list above and want to be, please let us know
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012-2015 Elasticsearch <http://www.elasticsearch.org>
1
+ Copyright (c) 20122015 Elasticsearch <http://www.elastic.co>
2
2
 
3
3
  Licensed under the Apache License, Version 2.0 (the "License");
4
4
  you may not use this file except in compliance with the License.
@@ -1,6 +1,95 @@
1
- # Permits to retrieve metrics from jmx.
1
+ # encoding: utf-8
2
+ require "logstash/inputs/base"
3
+ require "logstash/namespace"
4
+ require "logstash/json"
5
+
6
+ # This input plugin permits to retrieve metrics from remote Java applications using JMX.
7
+ # Every `polling_frequency`, it scans a folder containing json configuration
8
+ # files describing JVMs to monitor with metrics to retrieve.
9
+ # Then a pool of threads will retrieve metrics and create events.
10
+ #
11
+ # ## The configuration:
12
+ #
13
+ # In Logstash configuration, you must set the polling frequency,
14
+ # the number of thread used to poll metrics and a directory absolute path containing
15
+ # json files with the configuration per jvm of metrics to retrieve.
16
+ # Logstash input configuration example:
17
+ # [source,ruby]
18
+ # jmx {
19
+ # //Required
20
+ # path => "/apps/logstash_conf/jmxconf"
21
+ # //Optional, default 60s
22
+ # polling_frequency => 15
23
+ # type => "jmx"
24
+ # //Optional, default 4
25
+ # nb_thread => 4
26
+ # }
27
+ #
28
+ # Json JMX configuration example:
29
+ # [source,js]
30
+ # {
31
+ # //Required, JMX listening host/ip
32
+ # "host" : "192.168.1.2",
33
+ # //Required, JMX listening port
34
+ # "port" : 1335,
35
+ # //Optional, the username to connect to JMX
36
+ # "username" : "user",
37
+ # //Optional, the password to connect to JMX
38
+ # "password": "pass",
39
+ # //Optional, use this alias as a prefix in the metric name. If not set use <host>_<port>
40
+ # "alias" : "test.homeserver.elasticsearch",
41
+ # //Required, list of JMX metrics to retrieve
42
+ # "queries" : [
43
+ # {
44
+ # //Required, the object name of Mbean to request
45
+ # "object_name" : "java.lang:type=Memory",
46
+ # //Optional, use this alias in the metrics value instead of the object_name
47
+ # "object_alias" : "Memory"
48
+ # }, {
49
+ # "object_name" : "java.lang:type=Runtime",
50
+ # //Optional, set of attributes to retrieve. If not set retrieve
51
+ # //all metrics available on the configured object_name.
52
+ # "attributes" : [ "Uptime", "StartTime" ],
53
+ # "object_alias" : "Runtime"
54
+ # }, {
55
+ # //object_name can be configured with * to retrieve all matching Mbeans
56
+ # "object_name" : "java.lang:type=GarbageCollector,name=*",
57
+ # "attributes" : [ "CollectionCount", "CollectionTime" ],
58
+ # //object_alias can be based on specific value from the object_name thanks to ${<varname>}.
59
+ # //In this case ${type} will be replaced by GarbageCollector...
60
+ # "object_alias" : "${type}.${name}"
61
+ # }, {
62
+ # "object_name" : "java.nio:type=BufferPool,name=*",
63
+ # "object_alias" : "${type}.${name}"
64
+ # } ]
65
+ # }
66
+ #
67
+ # Here are examples of generated events. When returned metrics value type is
68
+ # number/boolean it is stored in `metric_value_number` event field
69
+ # otherwise it is stored in `metric_value_string` event field.
70
+ # [source,ruby]
71
+ # {
72
+ # "@version" => "1",
73
+ # "@timestamp" => "2014-02-18T20:57:27.688Z",
74
+ # "host" => "192.168.1.2",
75
+ # "path" => "/apps/logstash_conf/jmxconf",
76
+ # "type" => "jmx",
77
+ # "metric_path" => "test.homeserver.elasticsearch.GarbageCollector.ParNew.CollectionCount",
78
+ # "metric_value_number" => 2212
79
+ # }
80
+ #
81
+ # [source,ruby]
82
+ # {
83
+ # "@version" => "1",
84
+ # "@timestamp" => "2014-02-18T20:58:06.376Z",
85
+ # "host" => "localhost",
86
+ # "path" => "/apps/logstash_conf/jmxconf",
87
+ # "type" => "jmx",
88
+ # "metric_path" => "test.homeserver.elasticsearch.BufferPool.mapped.ObjectName",
89
+ # "metric_value_string" => "java.nio:type=BufferPool,name=mapped"
90
+ # }
91
+ #
2
92
  class LogStash::Inputs::Jmx < LogStash::Inputs::Base
3
- # TODO add documentation
4
93
  config_name 'jmx'
5
94
 
6
95
  #Class Var
@@ -10,7 +99,7 @@ class LogStash::Inputs::Jmx < LogStash::Inputs::Base
10
99
  # Path where json conf files are stored
11
100
  config :path, :validate => :string, :required => true
12
101
 
13
- # Indicate interval between to jmx metrics retrieval
102
+ # Indicate interval between two jmx metrics retrieval
14
103
  # (in s)
15
104
  config :polling_frequency, :validate => :number, :default => 60
16
105
 
@@ -20,11 +109,9 @@ class LogStash::Inputs::Jmx < LogStash::Inputs::Base
20
109
  # Read and parse json conf
21
110
  private
22
111
  def read_conf(file_conf)
23
- require 'json'
24
-
25
112
  @logger.debug("Parse json #{file_conf} to ruby data structure")
26
113
  json = File.read(file_conf)
27
- JSON.parse(json)
114
+ LogStash::Json.load(json)
28
115
  end
29
116
 
30
117
  # Verify that all required parameter are present in the conf_hash
@@ -1,13 +1,13 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-input-jmx'
4
- s.version = '0.1.3'
4
+ s.version = '0.1.4'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Retrieve metrics from jmx."
7
7
  s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program"
8
- s.authors = ["Elasticsearch"]
9
- s.email = 'info@elasticsearch.com'
10
- s.homepage = "http://www.elasticsearch.org/guide/en/logstash/current/index.html"
8
+ s.authors = ["Elastic"]
9
+ s.email = 'info@elastic.co'
10
+ s.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html"
11
11
  s.require_paths = ["lib"]
12
12
 
13
13
  # Files
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-jmx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
- - Elasticsearch
7
+ - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-26 00:00:00.000000000 Z
11
+ date: 2015-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -59,7 +59,7 @@ dependencies:
59
59
  - !ruby/object:Gem::Version
60
60
  version: '0'
61
61
  description: This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program
62
- email: info@elasticsearch.com
62
+ email: info@elastic.co
63
63
  executables: []
64
64
  extensions: []
65
65
  extra_rdoc_files: []
@@ -73,7 +73,7 @@ files:
73
73
  - lib/logstash/inputs/jmx.rb
74
74
  - logstash-input-jmx.gemspec
75
75
  - spec/inputs/jmx_spec.rb
76
- homepage: http://www.elasticsearch.org/guide/en/logstash/current/index.html
76
+ homepage: http://www.elastic.co/guide/en/logstash/current/index.html
77
77
  licenses:
78
78
  - Apache License (2.0)
79
79
  metadata:
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  version: '0'
96
96
  requirements: []
97
97
  rubyforge_project:
98
- rubygems_version: 2.4.5
98
+ rubygems_version: 2.1.9
99
99
  signing_key:
100
100
  specification_version: 4
101
101
  summary: Retrieve metrics from jmx.