fluent-plugin-mackerel 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +16 -0
- data/fluent-plugin-mackerel.gemspec +1 -1
- data/lib/fluent/plugin/out_mackerel.rb +2 -1
- data/test/plugin/test_out_mackerel.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YzRhYWRlZGQ3YmJjMDZjZTk5YjgzMjIwY2I2YTllOTZkZDdlMjZhOQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDgyMmQ2MWQwOTY3MmRmM2MwMGM2ODdmYzM5OTNiOTI3YzI0YjdlNw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YjVkNGZkM2RhNmQxYzUzYzQ2OTk0ZmRmZTdiNzkzYTNiOTAwMGNmNDQ0MDVl
|
10
|
+
ODQzZDI1YTI1MDEyODQ2NDQ3MDc4ZDU2YjMyMDIxYTc2Zjk3NzMzZmFmNGI5
|
11
|
+
ZWY0M2I3MzYzNzczYzMyMjQ0NDRjYTExOTFhYTQ4OThmMGZiNDc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZThiMDZmNzczMzU4ZmFiNTU4Y2VhNGU2YmQzNjdiNDA1OWE5MzA4MDJiM2Qx
|
14
|
+
YWNiOWQ5OGJiNjg2MTY2ZTMzNmEwNWQ2YTg5ZGQyNmUzYmU4ZmU1MjdjZWI0
|
15
|
+
ZWJjMDZmMzEyOTU3OTc2Yjc5ZDI1NzRiNzAxMGNlNDY3ZWFjZTg=
|
data/README.md
CHANGED
@@ -123,6 +123,22 @@ When releasing, call rake release as follows.
|
|
123
123
|
$ bundle exec rake release
|
124
124
|
```
|
125
125
|
|
126
|
+
For debugging purpose, you can change Mackerel endpoint by `origin` parameter like this.
|
127
|
+
```
|
128
|
+
<match ...>
|
129
|
+
type mackerel
|
130
|
+
api_key 123456
|
131
|
+
hostid xyz
|
132
|
+
metrics_name http_status.${out_key}
|
133
|
+
out_keys 2xx_count,3xx_count,4xx_count,5xx_count
|
134
|
+
origin https://example.com
|
135
|
+
</match>
|
136
|
+
```
|
137
|
+
|
138
|
+
## References
|
139
|
+
|
140
|
+
* [How to use fluent-plugin-mackerel (Japanese)](http://qiita.com/tksmd/items/1212331a5a18afe520df)
|
141
|
+
|
126
142
|
## Copyright
|
127
143
|
|
128
144
|
* Copyright (c) 2014- Takashi Someda ([@tksmd](http://twitter.com/tksmd/))
|
@@ -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.0.
|
7
|
+
spec.version = "0.0.6"
|
8
8
|
spec.authors = ["tksmd","hatz48"]
|
9
9
|
spec.email = ["someda@isenshi.com"]
|
10
10
|
spec.description = %q{fluent plugin to send metrics to mackerel.io}
|
@@ -10,6 +10,7 @@ module Fluent
|
|
10
10
|
config_param :service, :string, :default => nil
|
11
11
|
config_param :metrics_name, :string, :default => nil
|
12
12
|
config_param :out_keys, :string
|
13
|
+
config_param :origin, :string, :default => nil
|
13
14
|
|
14
15
|
attr_reader :mackerel
|
15
16
|
|
@@ -25,7 +26,7 @@ module Fluent
|
|
25
26
|
def configure(conf)
|
26
27
|
super
|
27
28
|
|
28
|
-
@mackerel = Mackerel::Client.new(:mackerel_api_key => conf['api_key'])
|
29
|
+
@mackerel = Mackerel::Client.new(:mackerel_api_key => conf['api_key'], :mackerel_origin => conf['origin'])
|
29
30
|
@out_keys = @out_keys.split(',')
|
30
31
|
|
31
32
|
if @flush_interval < 60
|
@@ -37,6 +37,15 @@ class MackerelOutputTest < Test::Unit::TestCase
|
|
37
37
|
flush_interval 1s
|
38
38
|
]
|
39
39
|
|
40
|
+
CONFIG_ORIGIN = %[
|
41
|
+
type mackerel
|
42
|
+
api_key 123456
|
43
|
+
hostid xyz
|
44
|
+
metrics_name service.${out_key}
|
45
|
+
out_keys val1,val2,val3
|
46
|
+
origin example.domain
|
47
|
+
]
|
48
|
+
|
40
49
|
def create_driver(conf = CONFIG, tag='test')
|
41
50
|
Fluent::Test::BufferedOutputTestDriver.new(Fluent::MackerelOutput, tag).configure(conf)
|
42
51
|
end
|
@@ -58,6 +67,9 @@ class MackerelOutputTest < Test::Unit::TestCase
|
|
58
67
|
d = create_driver(CONFIG_SMALL_FLUSH_INTERVAL)
|
59
68
|
assert_equal d.instance.instance_variable_get(:@flush_interval), 60
|
60
69
|
|
70
|
+
d = create_driver(CONFIG_ORIGIN)
|
71
|
+
assert_equal d.instance.instance_variable_get(:@origin), 'example.domain'
|
72
|
+
|
61
73
|
d = create_driver()
|
62
74
|
assert_equal d.instance.instance_variable_get(:@api_key), '123456'
|
63
75
|
assert_equal d.instance.instance_variable_get(:@hostid), 'xyz'
|
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.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tksmd
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-09-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mackerel-client
|