fluent-plugin-influxdb 0.2.5 → 0.2.6
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/History.md +7 -0
- data/fluent-plugin-influxdb.gemspec +1 -1
- data/lib/fluent/plugin/out_influxdb.rb +15 -5
- data/test/plugin/test_out_influxdb.rb +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a070089e8dc07509c16215ef08d368ec1091662c
|
4
|
+
data.tar.gz: df19de18d8a2614e49f48a2ed12c9dd97063a8b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b7eaeedded220c7941b2f9c2fa736ec84415c6f29b4ed3ef62e912af27dad0358068644ed4d596a36f9974ccb45ef609f9bbf59ce989079b374004c7e83e55e
|
7
|
+
data.tar.gz: 70ead7e7d18a23de64a6ab43a78a54aa81ee3172e50417d01b05fdc46f5f230bd24de4e277bfb5e7b481a41c52747ac9b69e9c543c1075bb9f5f89774e29d9b0
|
data/History.md
CHANGED
@@ -3,7 +3,7 @@ $:.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.2.
|
6
|
+
s.version = '0.2.6'
|
7
7
|
s.authors = ["Masahiro Nakagawa", "FangLi"]
|
8
8
|
s.email = ["repeatedly@gmail.com", "surivlee@gmail.com"]
|
9
9
|
s.description = %q{InfluxDB output plugin for Fluentd}
|
@@ -20,6 +20,10 @@ DESC
|
|
20
20
|
:desc => "The DB user of influxDB, should be created manually."
|
21
21
|
config_param :password, :string, :default => 'root', :secret => true,
|
22
22
|
:desc => "The password of the user."
|
23
|
+
config_param :retry, :integer, :default => nil,
|
24
|
+
:desc => 'The finite number of retry times. default is infinite'
|
25
|
+
config_param :time_key, :string, :default => 'time',
|
26
|
+
:desc => 'Use value of this tag if it exists in event instead of event timestamp'
|
23
27
|
config_param :time_precision, :string, :default => 's',
|
24
28
|
:desc => <<-DESC
|
25
29
|
The time precision of timestamp.
|
@@ -52,7 +56,7 @@ DESC
|
|
52
56
|
def start
|
53
57
|
super
|
54
58
|
|
55
|
-
$log.info "Connecting to database: #{@dbname}, host: #{@host}, port: #{@port}, username: #{@user},
|
59
|
+
$log.info "Connecting to database: #{@dbname}, host: #{@host}, port: #{@port}, username: #{@user}, use_ssl = #{@use_ssl}, verify_ssl = #{@verify_ssl}"
|
56
60
|
|
57
61
|
# ||= for testing.
|
58
62
|
@influxdb ||= InfluxDB::Client.new @dbname, host: @host,
|
@@ -60,13 +64,18 @@ DESC
|
|
60
64
|
username: @user,
|
61
65
|
password: @password,
|
62
66
|
async: false,
|
67
|
+
retry: @retry,
|
63
68
|
time_precision: @time_precision,
|
64
69
|
use_ssl: @use_ssl,
|
65
70
|
verify_ssl: @verify_ssl
|
66
71
|
|
67
|
-
|
68
|
-
|
69
|
-
|
72
|
+
begin
|
73
|
+
existing_databases = @influxdb.list_databases.map { |x| x['name'] }
|
74
|
+
unless existing_databases.include? @dbname
|
75
|
+
raise Fluent::ConfigError, 'Database ' + @dbname + ' doesn\'t exist. Create it first, please. Existing databases: ' + existing_databases.join(',')
|
76
|
+
end
|
77
|
+
rescue InfluxDB::AuthenticationError
|
78
|
+
$log.info "skip database presence check because '#{@user}' user doesn't have admin privilege. Check '#{@dbname}' exists on influxdb"
|
70
79
|
end
|
71
80
|
end
|
72
81
|
|
@@ -83,12 +92,13 @@ DESC
|
|
83
92
|
|
84
93
|
def shutdown
|
85
94
|
super
|
95
|
+
@influxdb.stop!
|
86
96
|
end
|
87
97
|
|
88
98
|
def write(chunk)
|
89
99
|
points = []
|
90
100
|
chunk.msgpack_each do |tag, time, record|
|
91
|
-
timestamp = record.delete(
|
101
|
+
timestamp = record.delete(@time_key) || time
|
92
102
|
if tag_keys.empty?
|
93
103
|
values = record
|
94
104
|
tags = {}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-influxdb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masahiro Nakagawa
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-04-
|
12
|
+
date: 2016-04-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fluentd
|