fluent-plugin-influxdb 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 +4 -4
- data/History.md +8 -2
- data/README.md +6 -2
- data/fluent-plugin-influxdb.gemspec +4 -4
- data/lib/fluent/plugin/out_influxdb.rb +12 -13
- metadata +15 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60609e2ceb90b9f7cccc5bf4a93ab7148cacf62d
|
4
|
+
data.tar.gz: ec43bfe20afecc28a8c753a8349aab16f5bad4f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab34d3a1fff3cb26472fe3865a664bbd0bf59ee3bc9bacfec93612686f1f4296fccb50ced6a40331219a1713cdf7c0a664fa86746eca25a2381e3a81ffe580d2
|
7
|
+
data.tar.gz: 388197910982006e628e36ac18f03c8658653b448983836d4d6259681d16558b74d28f474e3ebaa2e9cea7f84204df0c11f4df1dd3f98c8742b7d7d8b4f3d04c
|
data/History.md
CHANGED
@@ -1,12 +1,18 @@
|
|
1
1
|
Changelog
|
2
2
|
=========
|
3
3
|
|
4
|
+
0.1.3 (Apr 3, 2015)
|
5
|
+
=====
|
6
|
+
|
7
|
+
- Use influxdb gem to write data
|
8
|
+
- Ignore empty record to avoid client exception
|
9
|
+
|
4
10
|
0.1.2
|
5
11
|
=====
|
6
12
|
|
7
|
-
|
13
|
+
- Remove value recognize from configuration
|
8
14
|
|
9
15
|
0.1.0
|
10
16
|
=====
|
11
17
|
|
12
|
-
|
18
|
+
- Initial gem release.
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Fluent::Plugin::InfluxDB
|
1
|
+
# Fluent::Plugin::InfluxDB, a plugin for [Fluentd](http://fluentd.org)
|
2
2
|
|
3
3
|
fluent-plugin-influxdb is a buffered output plugin for fluentd and influxDB.
|
4
4
|
|
@@ -6,7 +6,7 @@ If you are using fluentd as a collector and want to organize your time-series da
|
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
9
|
-
$ gem install fluent-plugin-influxdb
|
9
|
+
$ fluent-gem install fluent-plugin-influxdb
|
10
10
|
|
11
11
|
## Usage
|
12
12
|
|
@@ -54,12 +54,16 @@ fluentd-plugin-influxdb is a buffered output plugin. So additional buffer config
|
|
54
54
|
|
55
55
|
```
|
56
56
|
buffer_type memory
|
57
|
+
buffer_chunk_limit 524288 # 512 * 1024
|
58
|
+
buffer_queue_limit 1024
|
57
59
|
flush_interval 60
|
58
60
|
retry_limit 17
|
59
61
|
retry_wait 1.0
|
60
62
|
num_threads 1
|
61
63
|
```
|
62
64
|
|
65
|
+
The details of BufferedOutput is [here](http://docs.fluentd.org/articles/buffer-plugin-overview).
|
66
|
+
|
63
67
|
---
|
64
68
|
|
65
69
|
Also please consider using [fluent-plugin-multiprocess](https://github.com/frsyuki/fluent-plugin-multiprocess) to fork multiple threads for your metrics:
|
@@ -3,9 +3,9 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "fluent-plugin-influxdb"
|
6
|
-
s.version = '0.1.
|
7
|
-
s.authors = ["FangLi"]
|
8
|
-
s.email = ["surivlee@gmail.com"]
|
6
|
+
s.version = '0.1.3'
|
7
|
+
s.authors = ["Masahiro Nakagawa", "FangLi"]
|
8
|
+
s.email = ["repeatedly@gmail.com", "surivlee@gmail.com"]
|
9
9
|
s.description = %q{InfluxDB output plugin for Fluentd}
|
10
10
|
s.summary = %q{A buffered output plugin for fluentd and influxDB}
|
11
11
|
s.homepage = "https://github.com/fangli/fluent-plugin-influxdb"
|
@@ -19,5 +19,5 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.add_runtime_dependency "fluentd"
|
20
20
|
|
21
21
|
s.add_development_dependency "rake"
|
22
|
-
s.add_development_dependency "
|
22
|
+
s.add_development_dependency "influxdb"
|
23
23
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
require 'date'
|
3
|
-
require '
|
3
|
+
require 'influxdb'
|
4
4
|
|
5
5
|
class Fluent::InfluxdbOutput < Fluent::BufferedOutput
|
6
6
|
Fluent::Plugin.register_output('influxdb', self)
|
@@ -19,6 +19,13 @@ class Fluent::InfluxdbOutput < Fluent::BufferedOutput
|
|
19
19
|
|
20
20
|
def configure(conf)
|
21
21
|
super
|
22
|
+
@influxdb = InfluxDB::Client.new @dbname, host: @host,
|
23
|
+
port: @port,
|
24
|
+
username: @user,
|
25
|
+
password: @password,
|
26
|
+
async: false,
|
27
|
+
time_precision: @time_precision
|
28
|
+
|
22
29
|
end
|
23
30
|
|
24
31
|
def start
|
@@ -34,19 +41,11 @@ class Fluent::InfluxdbOutput < Fluent::BufferedOutput
|
|
34
41
|
end
|
35
42
|
|
36
43
|
def write(chunk)
|
37
|
-
bulk = []
|
38
|
-
|
39
44
|
chunk.msgpack_each do |tag, time, record|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
}
|
45
|
+
unless record.empty?
|
46
|
+
record[:time] = time
|
47
|
+
@influxdb.write_point(tag, record)
|
48
|
+
end
|
45
49
|
end
|
46
|
-
|
47
|
-
http = Net::HTTP.new(@host, @port.to_i)
|
48
|
-
request = Net::HTTP::Post.new("/db/#{@dbname}/series?u=#{@user}&p=#{password}&time_precision=#{time_precision}", {'content-type' => 'application/json; charset=utf-8'})
|
49
|
-
request.body = Yajl::Encoder.encode(bulk)
|
50
|
-
http.request(request).value
|
51
50
|
end
|
52
51
|
end
|
metadata
CHANGED
@@ -1,65 +1,67 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-influxdb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
+
- Masahiro Nakagawa
|
7
8
|
- FangLi
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2015-04-03 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: fluentd
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
16
17
|
requirements:
|
17
|
-
- -
|
18
|
+
- - ">="
|
18
19
|
- !ruby/object:Gem::Version
|
19
20
|
version: '0'
|
20
21
|
type: :runtime
|
21
22
|
prerelease: false
|
22
23
|
version_requirements: !ruby/object:Gem::Requirement
|
23
24
|
requirements:
|
24
|
-
- -
|
25
|
+
- - ">="
|
25
26
|
- !ruby/object:Gem::Version
|
26
27
|
version: '0'
|
27
28
|
- !ruby/object:Gem::Dependency
|
28
29
|
name: rake
|
29
30
|
requirement: !ruby/object:Gem::Requirement
|
30
31
|
requirements:
|
31
|
-
- -
|
32
|
+
- - ">="
|
32
33
|
- !ruby/object:Gem::Version
|
33
34
|
version: '0'
|
34
35
|
type: :development
|
35
36
|
prerelease: false
|
36
37
|
version_requirements: !ruby/object:Gem::Requirement
|
37
38
|
requirements:
|
38
|
-
- -
|
39
|
+
- - ">="
|
39
40
|
- !ruby/object:Gem::Version
|
40
41
|
version: '0'
|
41
42
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
43
|
+
name: influxdb
|
43
44
|
requirement: !ruby/object:Gem::Requirement
|
44
45
|
requirements:
|
45
|
-
- -
|
46
|
+
- - ">="
|
46
47
|
- !ruby/object:Gem::Version
|
47
48
|
version: '0'
|
48
49
|
type: :development
|
49
50
|
prerelease: false
|
50
51
|
version_requirements: !ruby/object:Gem::Requirement
|
51
52
|
requirements:
|
52
|
-
- -
|
53
|
+
- - ">="
|
53
54
|
- !ruby/object:Gem::Version
|
54
55
|
version: '0'
|
55
56
|
description: InfluxDB output plugin for Fluentd
|
56
57
|
email:
|
58
|
+
- repeatedly@gmail.com
|
57
59
|
- surivlee@gmail.com
|
58
60
|
executables: []
|
59
61
|
extensions: []
|
60
62
|
extra_rdoc_files: []
|
61
63
|
files:
|
62
|
-
- .gitignore
|
64
|
+
- ".gitignore"
|
63
65
|
- Gemfile
|
64
66
|
- History.md
|
65
67
|
- LICENSE
|
@@ -78,17 +80,17 @@ require_paths:
|
|
78
80
|
- lib
|
79
81
|
required_ruby_version: !ruby/object:Gem::Requirement
|
80
82
|
requirements:
|
81
|
-
- -
|
83
|
+
- - ">="
|
82
84
|
- !ruby/object:Gem::Version
|
83
85
|
version: '0'
|
84
86
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
87
|
requirements:
|
86
|
-
- -
|
88
|
+
- - ">="
|
87
89
|
- !ruby/object:Gem::Version
|
88
90
|
version: '0'
|
89
91
|
requirements: []
|
90
92
|
rubyforge_project:
|
91
|
-
rubygems_version: 2.
|
93
|
+
rubygems_version: 2.2.2
|
92
94
|
signing_key:
|
93
95
|
specification_version: 4
|
94
96
|
summary: A buffered output plugin for fluentd and influxDB
|