logstash-output-influxdb2 0.3.0 → 0.4.0

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
  SHA256:
3
- metadata.gz: 035f5cd14ba056bc64a0ebb7b72ec8105971a77c1e783999eddda344f2ad4484
4
- data.tar.gz: 5cdefdfb6a6e97a61a8846966c8d107255180d07eabcdc6212c69493f55f76ca
3
+ metadata.gz: 3dfd75d3189d4c6d414de1de45c4bc1cc238edab17b80c46f5854b69d40bf2a2
4
+ data.tar.gz: 016e508f44b388e632fa97a06fb8643691083b174495261305e48285d645da27
5
5
  SHA512:
6
- metadata.gz: 4b4b6dc6bc430e96604061857a124e2e333b89ea21ccab0a5c09d51462272a0fa872513cc89bcd1264c2e11c72f05e76bb5667e4a633316ef626d279c48bdc1e
7
- data.tar.gz: f617a63ae417d5c778e0e569f9ac22a40f621011ea83f116889721604582ae45ae2537c61be4aa1ce9c5a4d7a0dc2682dd0755940fc3417f3984e8e4cebda3f8
6
+ metadata.gz: 8dc471f8845297d388f0cec6954da91b4d43149119df5bc5fa6c1a92fb3be740b523352728a95acf4f01159d95d0b21c0c3494dfacceb7219eed1593f9bf8abc
7
+ data.tar.gz: 3841350260e5bb965517caa45ce513a047dd6ec3046f0ff54c3e7703709158c3c5fd6eef4aef01297c9d22feeaaa7a963d15783941f93d43ac3eb9156f4e4b72
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.4.0
2
+ - Update documents
3
+ - Change tags to optional
4
+
1
5
  ## 0.3.0
2
6
  - Add guards for invalid event
3
7
  - Remove include_tags and exclude_tags
@@ -14,7 +14,7 @@ class LogStash::Outputs::InfluxDB2 < LogStash::Outputs::Base
14
14
  config :write_options, :validate => :hash, :default => {}
15
15
 
16
16
  config :measurement, :validate => :string, :required => true
17
- config :tags, :validate => :string, :required => true
17
+ config :tags, :validate => :string
18
18
  config :fields, :validate => :string, :required => true
19
19
 
20
20
  config :escape_value, :validate => :boolean, :default => false
@@ -30,9 +30,9 @@ class LogStash::Outputs::InfluxDB2 < LogStash::Outputs::Base
30
30
  public
31
31
  def receive(event)
32
32
  fields = event.get(@fields)
33
- return unless fields.is_a?(Hash) && fields.size > 0
33
+ return unless fields.is_a?(Hash) && ! fields.empty?
34
34
 
35
- tags = event.get(@tags)
35
+ tags = @tags.nil? ? nil : event.get(@tags)
36
36
  return unless tags.nil? || tags.is_a?(Hash)
37
37
 
38
38
  unless @escape_value
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-influxdb2'
3
- s.version = '0.3.0'
3
+ s.version = '0.4.0'
4
4
  s.licenses = ['Apache-2.0']
5
5
  s.summary = 'Writes metrics to InfluxDB 2.x'
6
6
  s.description = 'This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program'
@@ -14,7 +14,6 @@ describe LogStash::Outputs::InfluxDB2 do
14
14
  "url" => "http://localhost:8086",
15
15
  "token" => "token123",
16
16
  "measurement" => "%{[kubernetes][labels][app]}",
17
- "tags" => "[prometheus][labels]",
18
17
  "fields" => "[prometheus][metrics]"
19
18
  }
20
19
  end
@@ -56,7 +55,7 @@ describe LogStash::Outputs::InfluxDB2 do
56
55
  expect(write_options.batch_abort_on_exception).to be false
57
56
 
58
57
  expect(subject.instance_variable_get(:@measurement)).to eq "%{[kubernetes][labels][app]}"
59
- expect(subject.instance_variable_get(:@tags)).to eq "[prometheus][labels]"
58
+ expect(subject.instance_variable_get(:@tags)).to be_nil
60
59
  expect(subject.instance_variable_get(:@fields)).to eq "[prometheus][metrics]"
61
60
  expect(subject.instance_variable_get(:@escape_value)).to be false
62
61
  end
@@ -332,8 +331,8 @@ describe LogStash::Outputs::InfluxDB2 do
332
331
  "@timestamp" => "2020-01-01T00:00:00Z",
333
332
  "kubernetes" => { "labels" => { "app" => "dummy" } },
334
333
  "prometheus" => {
335
- "metrics" => { "count" => 123.0 }
336
334
  # Valid: no labels!
335
+ "metrics" => { "count" => 123.0 }
337
336
  }
338
337
  ))
339
338
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-influxdb2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Issey Yamakoshi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-22 00:00:00.000000000 Z
11
+ date: 2023-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logstash-core-plugin-api