fluent-plugin-influxdb 0.2.5 → 0.2.6

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: 17b05b4d4062e69351985214664cd8802f693884
4
- data.tar.gz: 7c48f1472a0f615416011887c55aefdc2d8a4b90
3
+ metadata.gz: a070089e8dc07509c16215ef08d368ec1091662c
4
+ data.tar.gz: df19de18d8a2614e49f48a2ed12c9dd97063a8b3
5
5
  SHA512:
6
- metadata.gz: 1c40c346d389f84f42504510270a31d18ec8395535ca2335172a7796367f31f4906bd12580fe36f4ae5aa5b59dd98ab33e7f1bdb0f787d4c5787794d493d46d8
7
- data.tar.gz: 7bfa200fbf29e479259e39466929494fe36cf7e33e56cda96190c814d7996da676226eaa31685d64497603c0873f62b1d8f5033436114365399d630629e359d4
6
+ metadata.gz: 6b7eaeedded220c7941b2f9c2fa736ec84415c6f29b4ed3ef62e912af27dad0358068644ed4d596a36f9974ccb45ef609f9bbf59ce989079b374004c7e83e55e
7
+ data.tar.gz: 70ead7e7d18a23de64a6ab43a78a54aa81ee3172e50417d01b05fdc46f5f230bd24de4e277bfb5e7b481a41c52747ac9b69e9c543c1075bb9f5f89774e29d9b0
data/History.md CHANGED
@@ -1,6 +1,13 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ 0.2.6 (Apr, 22, 2016)
5
+ =====
6
+
7
+ - Add time_key parameter
8
+ - Add retry parameter
9
+ - Skip database check when user doesn't have right permission
10
+
4
11
  0.2.5 (Apr, 19, 2016)
5
12
  =====
6
13
 
@@ -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.5'
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}, password = #{@password}, use_ssl = #{@use_ssl}, verify_ssl = #{@verify_ssl}"
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
- existing_databases = @influxdb.list_databases.map { |x| x['name'] }
68
- unless existing_databases.include? @dbname
69
- raise Fluent::ConfigError, 'Database ' + @dbname + ' doesn\'t exist. Create it first, please. Existing databases: ' + existing_databases.join(',')
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('time') || time
101
+ timestamp = record.delete(@time_key) || time
92
102
  if tag_keys.empty?
93
103
  values = record
94
104
  tags = {}
@@ -15,6 +15,9 @@ class InfluxdbOutputTest < Test::Unit::TestCase
15
15
  def write_points(points)
16
16
  @points += points
17
17
  end
18
+
19
+ def stop!
20
+ end
18
21
  end
19
22
 
20
23
  def setup
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.5
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-20 00:00:00.000000000 Z
12
+ date: 2016-04-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd