fluent-plugin-mackerel 0.1.2 → 0.1.3

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: fba2647b6e58433c48d7f479da35206aa0f0ef4e
4
- data.tar.gz: d775a6c6c53739eb1e3503968b5780de18773133
3
+ metadata.gz: 8a02664ca113a287a4b0168e01ffbe73cf0cf1dc
4
+ data.tar.gz: bf339f5f4dd9c5a5b8f45556dda7ba70fb0b6df8
5
5
  SHA512:
6
- metadata.gz: 6ce5fea01ec17d19e7587a8ec46f116827f27ab1ecb7d7eca5cd2b9cdf72a09b741e4f902e7c3af6327e8e8f5b9f21318a169bf4eb1ea9b1e1bdc6d7c20c69b3
7
- data.tar.gz: ad0c53ceaf70db022eb3a5cea4b2ccd5fbdb2c5797d145f4568992fc8cf0a94a93e36b4c04f84b671a78395e323815d82cd538750277f2c514b8742f696c76c8
6
+ metadata.gz: ec37b759c0234771d0d2cc89b48be35202e13d746da9bfed086795a5ce7579b290d9699e1cdb5ef092bec2f5a108b11299e4abdf85685d2a5e167fb9f2972f0f
7
+ data.tar.gz: 86dfe07a76ceaec0f37075aa2b60fb4cb6eb2d0a4aa358c454d54804a727172dd4c7387c2da53bb6fbe274d663fd6a21b1ba3f8736fdd81d79f6f980a8ac5a4f
data/README.md CHANGED
@@ -2,13 +2,13 @@
2
2
 
3
3
  ## Overview
4
4
 
5
- [Fluentd](http://fluentd.org) plugin to send metrics to [mackerel.io](http://mackerel.io/).
5
+ This is the plugin for sending metrics to [mackerel.io](http://mackerel.io/) using [Fluentd](http://fluentd.org).
6
6
 
7
- This plugin includes two components, namely MackerelOutput and MackerelHostidTagOutput. The former is used to send metrics to mackerel and the latter is used to append mackerel hostid to tag or record.
7
+ This plugin includes two components, MackerelOutput and MackerelHostidTagOutput. The former is used to send metrics to Mackerel and the latter is used to append the Mackerel hostid for tagging or recording.
8
8
 
9
9
  ## Installation
10
10
 
11
- Install with gem or fluent-gem command as:
11
+ Install with either the gem or fluent-gem command as shown:
12
12
 
13
13
  ```
14
14
  # for fluentd
@@ -22,7 +22,7 @@ $ sudo /usr/lib64/fluent/ruby/bin/fluent-gem install fluent-plugin-mackerel
22
22
 
23
23
  ### MackerelOutput
24
24
 
25
- This plugin uses [APIv0](http://help-ja.mackerel.io/entry/spec/api/v0) of mackerel.io.
25
+ This plugin uses mackerel.io's [APIv0](http://help-ja.mackerel.io/entry/spec/api/v0).
26
26
  ```
27
27
  <match ...>
28
28
  type mackerel
@@ -34,7 +34,7 @@ This plugin uses [APIv0](http://help-ja.mackerel.io/entry/spec/api/v0) of macker
34
34
  </match>
35
35
  ```
36
36
 
37
- Then the sent metric data will look like this:
37
+ Metric data that has been sent will look like this:
38
38
  ```
39
39
  {
40
40
  "hostId": "xyz",
@@ -45,10 +45,10 @@ Then the sent metric data will look like this:
45
45
  ```
46
46
  As shown above, `${out_key}` will be replaced with out_key like "2xx_count" when sending metrics.
47
47
 
48
- In the case some outkeys do not have any value, the value will be set to `0` with `use_zero_for_empty`, the default of which is true.
49
- For example, you set `out_keys 2xx_count,3xx_count,4xx_count,5xx_count`, but you only get `2xx_count`, `3xx_count` and `4xx_count`, then `5xx_count` will be set to `0` with `use_zero_for_empty`.
48
+ In the case an outkey does not have any value, the value will be set to `0` with `use_zero_for_empty`, the default of which is true.
49
+ For example, if you have set `out_keys 2xx_count,3xx_count,4xx_count,5xx_count`, but only get `2xx_count`, `3xx_count` and `4xx_count`, then `5xx_count` will be set to `0` with `use_zero_for_empty`.
50
50
 
51
- You can use `out_key_pattern` instead of `out_keys`. Input records whose key matches the pattern set to `out_key_pattern` will be sent. Either `out_keys` or `out_key_pattern` is required.
51
+ `out_key_pattern` can be used instead of `out_keys`. Input records whose keys match the pattern set to `out_key_pattern` will be sent. Either `out_keys` or `out_key_pattern` is required.
52
52
 
53
53
  ```
54
54
  <match ...>
@@ -59,7 +59,7 @@ You can use `out_key_pattern` instead of `out_keys`. Input records whose key mat
59
59
  out_key_pattern [2-5]xx_count
60
60
  ```
61
61
 
62
- You can use `${[n]}` for `metrics_name` where `n` represents any decimal number including negative value,
62
+ `${[n]}` can be used as a tag for `metrics_name` where `n` represents any decimal number including negative values.
63
63
 
64
64
  ```
65
65
  <match mackerel.*>
@@ -71,7 +71,7 @@ You can use `${[n]}` for `metrics_name` where `n` represents any decimal number
71
71
  </match>
72
72
  ```
73
73
 
74
- then it indicates value of the `n` th index of the array got by splitting the tag by `.` (dot) and get the following output when the tag is `mackerel.http_status`.
74
+ This indicates the value of the `n` th index of the array. By splitting the tag with a `.` (dot) the following output can be got when the tag is `mackerel.http_status`.
75
75
  ```
76
76
  {
77
77
  "hostId": "xyz",
@@ -80,9 +80,9 @@ then it indicates value of the `n` th index of the array got by splitting the ta
80
80
  "value": 100.0
81
81
  }
82
82
  ```
83
- "custom" will be appended to the `name` attribute before sending metrics to mackerel automatically.
83
+ "custom" will be automatically appended to the `name` attribute before sending metrics to mackerel.
84
84
 
85
- You can also send ["service" metric](http://help-ja.mackerel.io/entry/spec/api/v0#service-metric-value-post) as follows.
85
+ You can also send [service metrics](http://help.mackerel.io/entry/spec/api/v0#service-metric-value-post) as shown.
86
86
  ```
87
87
  <match ...>
88
88
  type mackerel
@@ -93,8 +93,8 @@ You can also send ["service" metric](http://help-ja.mackerel.io/entry/spec/api/v
93
93
  </match>
94
94
  ```
95
95
 
96
- When you send service metric, "custom" can be removed with `remove_prefix` as follows.
97
- This option is not availabe when sending host metric.
96
+ When sending service metrics, the prefix "custom" can be removed with `remove_prefix` as follows.
97
+ This option is not availabe when sending host metrics.
98
98
 
99
99
  ```
100
100
  <match ...>
@@ -107,20 +107,20 @@ This option is not availabe when sending host metric.
107
107
  </match>
108
108
  ```
109
109
 
110
- `flush_interval` is not allowed to be set less than 60 secs not to send API requests more than once in a minute.
110
+ `flush_interval` may not be set to less than 60 seconds so as not to send API requests more than once per minute.
111
111
 
112
- This plugin overwrites the default value of `buffer_queue_limit` and `buffer_chunk_limit` as follows.
112
+ This plugin overwrites the default values of `buffer_queue_limit` and `buffer_chunk_limit` as shown.
113
113
 
114
114
  * buffer_queue_limit to 4096
115
115
  * buffer_chunk_limit to 100K
116
116
 
117
- Without any special reasons to change, you should leave them as they are.
117
+ Unless there is some particular reason to change these values, we suggest leaving them as is.
118
118
 
119
- Since version 0.0.4, metrics_prefix was removed and you should use metrics_name instead.
119
+ From version 0.0.4 and on, metrics_prefix has been removed and metrics_name should be used instead.
120
120
 
121
121
  ### MackerelHostidTagOutput
122
122
 
123
- If you want to add the hostid to the record with a certain key name, do the following.
123
+ Let's say you want to add the hostid to the record with a specific key name...
124
124
  ```
125
125
  <match ...>
126
126
  type mackerel_hostid_tag
@@ -128,16 +128,16 @@ If you want to add the hostid to the record with a certain key name, do the foll
128
128
  key_name mackerel_hostid
129
129
  </match>
130
130
  ```
131
- As shown above, key_name field is required. Supposed host_id is "xyz" and input is `["test", 1407650400, {"val1"=>1, "val2"=>2, "val3"=>3, "val4"=>4}]`, then you can get `["test", 1407650400, {"val1"=>1, "val2"=>2, "val3"=>3, "val4"=>4, "mackerel_hostid"=>"xyz"}]`
131
+ As shown above, the key_name field is required. For example if the host_id is "xyz" and input is `["test", 1407650400, {"val1"=>1, "val2"=>2, "val3"=>3, "val4"=>4}]`, you'll get `["test", 1407650400, {"val1"=>1, "val2"=>2, "val3"=>3, "val4"=>4, "mackerel_hostid"=>"xyz"}]`
132
132
 
133
- To append hostid to the tag, you can simply configure "add_to" as "tag" like this.
133
+ To append the hostid to the tag, you can simply configure "add_to" as "tag" like this.
134
134
  ```
135
135
  <match ...>
136
136
  type mackerel_hostid_tag
137
137
  add_to tag
138
138
  </match>
139
139
  ```
140
- When input is `["test", 1407650400, {"val1"=>1, "val2"=>2, "val3"=>3, "val4"=>4}]`, then the output will be `["test.xyz", 1407650400, {"val1"=>1, "val2"=>2, "val3"=>3, "val4"=>4}]`
140
+ If the input is `["test", 1407650400, {"val1"=>1, "val2"=>2, "val3"=>3, "val4"=>4}]`, then the output will be `["test.xyz", 1407650400, {"val1"=>1, "val2"=>2, "val3"=>3, "val4"=>4}]`
141
141
 
142
142
  ## TODO
143
143
 
@@ -145,12 +145,12 @@ Pull requests are very welcome!!
145
145
 
146
146
  ## For developers
147
147
 
148
- You have to run the command below when starting development.
148
+ You'll need to run the command below when starting development.
149
149
  ```
150
150
  $ bundle install --path vendor/bundle
151
151
  ```
152
152
 
153
- To run tests, do the following.
153
+ To run tests...
154
154
  ```
155
155
  $ VERBOSE=1 bundle exec rake test
156
156
  ```
@@ -160,17 +160,17 @@ If you want to run a certain file, run rake like this
160
160
  $ VERBOSE=1 bundle exec rake test TEST=test/plugin/test_out_mackerel.rb
161
161
  ```
162
162
 
163
- In addition, you can run specific method like this.
163
+ Additionally, you can run a specific method like this.
164
164
  ```
165
165
  $ VERBOSE=1 bundle exec rake test TEST=test/plugin/test_out_mackerel.rb TESTOPTS="--name=test_configure"
166
166
  ```
167
167
 
168
- When releasing, call rake release as follows.
168
+ When releasing, call rake release as shown.
169
169
  ```
170
170
  $ bundle exec rake release
171
171
  ```
172
172
 
173
- For debugging purpose, you can change Mackerel endpoint by `origin` parameter like this.
173
+ For debugging purposes, you can change the Mackerel endpoint with an `origin` parameter like this.
174
174
  ```
175
175
  <match ...>
176
176
  type mackerel
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "fluent-plugin-mackerel"
7
- spec.version = "0.1.2"
7
+ spec.version = "0.1.3"
8
8
  spec.authors = ["tksmd","hatz48","stanaka","Songmu"]
9
9
  spec.email = ["developers@mackerel.io"]
10
10
  spec.description = %q{fluent plugin to send metrics to mackerel.io}
@@ -4,7 +4,7 @@ module Fluent
4
4
  class MackerelOutput < Fluent::BufferedOutput
5
5
  Fluent::Plugin.register_output('mackerel', self)
6
6
 
7
- config_param :api_key, :string
7
+ config_param :api_key, :string, :secret => true
8
8
  config_param :hostid, :string, :default => nil
9
9
  config_param :hostid_path, :string, :default => nil
10
10
  config_param :service, :string, :default => nil
@@ -14,6 +14,11 @@ module Fluent
14
14
  define_method("log") { $log }
15
15
  end
16
16
 
17
+ # Define `router` method to support v0.10.57 or earlier
18
+ unless method_defined?(:router)
19
+ define_method("router") { Fluent::Engine }
20
+ end
21
+
17
22
  def initialize
18
23
  super
19
24
  end
@@ -49,7 +54,7 @@ module Fluent
49
54
  if @add_to == 'record'
50
55
  record[@key_name] = @hostid
51
56
  end
52
- Fluent::Engine.emit(tag, time, record)
57
+ router.emit(tag, time, record)
53
58
  end
54
59
 
55
60
  chain.next
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-mackerel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - tksmd
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2015-04-14 00:00:00.000000000 Z
14
+ date: 2015-08-14 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: mackerel-client
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
137
  version: '0'
138
138
  requirements: []
139
139
  rubyforge_project:
140
- rubygems_version: 2.4.5
140
+ rubygems_version: 2.2.2
141
141
  signing_key:
142
142
  specification_version: 4
143
143
  summary: fluent plugin to send metrics to mackerel.io