logstash-output-scalyr 0.2.2 → 0.2.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b6b9327052bb3d05f9d043f6c9d2c02456f3b300ceb0355abae8b7d050e99fb9
4
- data.tar.gz: 1ff559076075d0b49728fce8bf103452d21d3c48ce9eff1a58d5d3c786b582f6
3
+ metadata.gz: ba6f9b828f98401b5f19e040e84f64a27de65fb6c41d4405c44b8038aac52450
4
+ data.tar.gz: 2aeed49b1518ea70df9f41bf4b627b748e23cd85104b45d96ce140d428220939
5
5
  SHA512:
6
- metadata.gz: a1ac7b6792503f9cff444962efbc33f349cad7c9d525beaed05bcdc57ebadc5d688381c235fa21d2ff5004d6ca3277ac62336f027ba3880be1d9b01d40006f75
7
- data.tar.gz: f07bcc497143581032ded69de2a6c833e4ea422e88fbbf12080adb07388e1f57cedc42319b1aca84f668e47c1d567ac25b4d3787bae74c84674416227ca9ba93
6
+ metadata.gz: d14976aa00f8d3a8021b9b955bf76102e003def61dff4b89069dff3ad6ca3c5861ed93ce3c500c7991aa809bcdbc3d3b4f601ae151bcf20e87d56ee3ce59d848
7
+ data.tar.gz: 9728d3b1925621e80e5623c208fe4125d18ba856d4358b109f6879ea1533da97a587b2f659c15ec90f04140dbf92640d122f5c2ed8e1c8f4cc5ec7bb5a12aa77
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Beta
2
2
 
3
+ ## 0.2.3
4
+
5
+ - Increase default number of maximum retry attempts on failure from `5` to `15`.
6
+ - Change "Unexpected error occurred while uploading to Scalyr (will backoff-retry)" message to
7
+ be logged under WARNING and not ERROR log level. This error is not fatal and simply indicates
8
+ client will retry a failed request. We use WARNING and not INFO so we still have visibility into
9
+ those messages (since most deployments have log level set to WARNING or above).
10
+
3
11
  ## 0.2.2
4
12
 
5
13
  - No longer vendor dependencies in the gem. This gem used to vendor a vulnerable log4j version
data/README.md CHANGED
@@ -9,9 +9,9 @@ You can view documentation for this plugin [on the Scalyr website](https://app.s
9
9
  # Quick start
10
10
 
11
11
  1. Build the gem, run `gem build logstash-output-scalyr.gemspec`
12
- 2. Install the gem into a Logstash installation, run `/usr/share/logstash/bin/logstash-plugin install logstash-output-scalyr-0.2.2.gem`
12
+ 2. Install the gem into a Logstash installation, run `/usr/share/logstash/bin/logstash-plugin install logstash-output-scalyr-0.2.3.gem`
13
13
  or follow the latest official instructions on working with plugins from Logstash. As an alternative, you can directly install latest
14
- stable version from RubyGems - ``/usr/share/logstash/bin/logstash-plugin --version 0.2.2 logstash-output-scalyr``
14
+ stable version from RubyGems - ``/usr/share/logstash/bin/logstash-plugin --version 0.2.3 logstash-output-scalyr``
15
15
  3. Configure the output plugin (e.g. add it to a pipeline .conf)
16
16
  4. Restart Logstash
17
17
 
@@ -477,7 +477,7 @@ git clone https://github.com/Kami/logstash-config-tester ~/
477
477
  gem build logstash-output-scalyr.gemspec
478
478
 
479
479
  # 2. Copy it to the config test repo
480
- cp logstash-output-scalyr-0.2.2.gem ~/logstash-config-test/logstash-output-scalyr.gem
480
+ cp logstash-output-scalyr-0.2.3.gem ~/logstash-config-test/logstash-output-scalyr.gem
481
481
 
482
482
  # 3. Build docker image with the latest dev version of the plugin (may take a while)
483
483
  docker-compose build
@@ -105,7 +105,9 @@ class LogStash::Outputs::Scalyr < LogStash::Outputs::Base
105
105
  # Initial interval in seconds between bulk retries. Doubled on each retry up to `retry_max_interval`
106
106
  config :retry_initial_interval, :validate => :number, :default => 1
107
107
  # How many times to retry sending an event before giving up on it
108
- config :max_retries, :validate => :number, :default => 5
108
+ # This will result in a total of around 12 minutes of retrying / sleeping with a default value
109
+ # for retry_max_interval
110
+ config :max_retries, :validate => :number, :default => 15
109
111
  # Whether or not to send messages that failed to send a max_retries amount of times to the DLQ or just drop them
110
112
  config :send_to_dlq, :validate => :boolean, :default => true
111
113
 
@@ -504,8 +506,8 @@ class LogStash::Outputs::Scalyr < LogStash::Outputs::Base
504
506
  @logger.debug(message, exc_data)
505
507
  exc_commonly_retried = true
506
508
  else
507
- # all other failed uploads should be errors
508
- @logger.error(message, exc_data)
509
+ # all other failed uploads should be warning
510
+ @logger.warn(message, exc_data)
509
511
  exc_commonly_retried = false
510
512
  end
511
513
  retry if @running and exc_retries < @max_retries
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- PLUGIN_VERSION = "v0.2.2"
2
+ PLUGIN_VERSION = "v0.2.3"
3
3
 
4
4
  # Special event level attribute name which can be used for setting event level serverHost attribute
5
5
  EVENT_LEVEL_SERVER_HOST_ATTRIBUTE_NAME = '__origServerHost'
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-scalyr'
3
- s.version = '0.2.2'
3
+ s.version = '0.2.3'
4
4
  s.licenses = ['Apache-2.0']
5
5
  s.summary = "Scalyr output plugin for Logstash"
6
6
  s.description = "Sends log data collected by Logstash to Scalyr (https://www.scalyr.com)"
@@ -42,9 +42,9 @@ describe LogStash::Outputs::Scalyr do
42
42
  })
43
43
  plugin.register
44
44
  plugin.instance_variable_set(:@running, false)
45
- allow(plugin.instance_variable_get(:@logger)).to receive(:error)
45
+ allow(plugin.instance_variable_get(:@logger)).to receive(:warn)
46
46
  plugin.multi_receive(sample_events)
47
- expect(plugin.instance_variable_get(:@logger)).to have_received(:error).with("Error uploading to Scalyr (will backoff-retry)",
47
+ expect(plugin.instance_variable_get(:@logger)).to have_received(:warn).with("Error uploading to Scalyr (will backoff-retry)",
48
48
  {
49
49
  :error_class=>"Scalyr::Common::Client::ServerError",
50
50
  :batch_num=>1,
@@ -71,9 +71,9 @@ describe LogStash::Outputs::Scalyr do
71
71
  })
72
72
  plugin.register
73
73
  plugin.instance_variable_set(:@running, false)
74
- allow(plugin.instance_variable_get(:@logger)).to receive(:error)
74
+ allow(plugin.instance_variable_get(:@logger)).to receive(:warn)
75
75
  plugin.multi_receive(sample_events)
76
- expect(plugin.instance_variable_get(:@logger)).to have_received(:error).with("Error uploading to Scalyr (will backoff-retry)",
76
+ expect(plugin.instance_variable_get(:@logger)).to have_received(:warn).with("Error uploading to Scalyr (will backoff-retry)",
77
77
  {
78
78
  :error_class=>"Manticore::UnknownException",
79
79
  :batch_num=>1,
@@ -101,9 +101,9 @@ describe LogStash::Outputs::Scalyr do
101
101
  })
102
102
  plugin.register
103
103
  plugin.instance_variable_set(:@running, false)
104
- allow(plugin.instance_variable_get(:@logger)).to receive(:error)
104
+ allow(plugin.instance_variable_get(:@logger)).to receive(:warn)
105
105
  plugin.multi_receive(sample_events)
106
- expect(plugin.instance_variable_get(:@logger)).to have_received(:error).with("Error uploading to Scalyr (will backoff-retry)",
106
+ expect(plugin.instance_variable_get(:@logger)).to have_received(:warn).with("Error uploading to Scalyr (will backoff-retry)",
107
107
  {
108
108
  :error_class=>"Manticore::UnknownException",
109
109
  :batch_num=>1,
@@ -144,9 +144,9 @@ describe LogStash::Outputs::Scalyr do
144
144
  })
145
145
  plugin.register
146
146
  plugin.instance_variable_set(:@running, false)
147
- allow(plugin.instance_variable_get(:@logger)).to receive(:error)
147
+ allow(plugin.instance_variable_get(:@logger)).to receive(:warn)
148
148
  plugin.multi_receive(sample_events)
149
- expect(plugin.instance_variable_get(:@logger)).to have_received(:error).with("Error uploading to Scalyr (will backoff-retry)",
149
+ expect(plugin.instance_variable_get(:@logger)).to have_received(:warn).with("Error uploading to Scalyr (will backoff-retry)",
150
150
  {
151
151
  :error_class=>"Manticore::UnknownException",
152
152
  :batch_num=>1,
@@ -166,7 +166,7 @@ describe LogStash::Outputs::Scalyr do
166
166
  end
167
167
  end
168
168
 
169
- context "when an error occurs with retries at 5" do
169
+ context "when an error occurs with retries at 15" do
170
170
  it "exits after 5 retries and emits a log" do
171
171
  plugin = LogStash::Outputs::Scalyr.new({
172
172
  'api_write_token' => '1234',
@@ -178,7 +178,7 @@ describe LogStash::Outputs::Scalyr do
178
178
  plugin.register
179
179
  allow(plugin.instance_variable_get(:@logger)).to receive(:error)
180
180
  plugin.multi_receive(sample_events)
181
- expect(plugin.instance_variable_get(:@logger)).to have_received(:error).with("Failed to send 3 events after 5 tries.", anything
181
+ expect(plugin.instance_variable_get(:@logger)).to have_received(:error).with("Failed to send 3 events after 15 tries.", anything
182
182
  )
183
183
  end
184
184
  end
@@ -232,9 +232,9 @@ describe LogStash::Outputs::Scalyr do
232
232
  plugin.register
233
233
  plugin.instance_variable_set(:@running, false)
234
234
 
235
- allow(plugin.instance_variable_get(:@logger)).to receive(:error)
235
+ allow(plugin.instance_variable_get(:@logger)).to receive(:warn)
236
236
  plugin.multi_receive(sample_events)
237
- expect(plugin.instance_variable_get(:@logger)).to have_received(:error).with("Error uploading to Scalyr (will backoff-retry)",
237
+ expect(plugin.instance_variable_get(:@logger)).to have_received(:warn).with("Error uploading to Scalyr (will backoff-retry)",
238
238
  {
239
239
  :error_class=>"Scalyr::Common::Client::ServerError",
240
240
  :batch_num=>1,
@@ -265,9 +265,9 @@ describe LogStash::Outputs::Scalyr do
265
265
  plugin.register
266
266
  plugin.instance_variable_set(:@running, false)
267
267
 
268
- allow(plugin.instance_variable_get(:@logger)).to receive(:error)
268
+ allow(plugin.instance_variable_get(:@logger)).to receive(:warn)
269
269
  plugin.multi_receive(sample_events)
270
- expect(plugin.instance_variable_get(:@logger)).to have_received(:error).with("Error uploading to Scalyr (will backoff-retry)",
270
+ expect(plugin.instance_variable_get(:@logger)).to have_received(:warn).with("Error uploading to Scalyr (will backoff-retry)",
271
271
  {
272
272
  :error_class=>"Scalyr::Common::Client::ServerError",
273
273
  :batch_num=>1,
@@ -1071,7 +1071,6 @@ describe LogStash::Outputs::Scalyr do
1071
1071
  it "throws on invalid hostname" do
1072
1072
  config = {
1073
1073
  'api_write_token' => '1234',
1074
- 'perform_connectivity_check' => false,
1075
1074
  'scalyr_server' => 'https://agent.invalid.foo.scalyr.com',
1076
1075
  'perform_connectivity_check' => true
1077
1076
  }
@@ -1082,7 +1081,6 @@ describe LogStash::Outputs::Scalyr do
1082
1081
  it "throws on invalid api key" do
1083
1082
  config = {
1084
1083
  'api_write_token' => '1234',
1085
- 'perform_connectivity_check' => false,
1086
1084
  'scalyr_server' => 'https://agent.scalyr.com',
1087
1085
  'perform_connectivity_check' => true
1088
1086
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-scalyr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edward Chee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-15 00:00:00.000000000 Z
11
+ date: 2022-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement