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 +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +3 -3
- data/lib/logstash/outputs/scalyr.rb +5 -3
- data/lib/scalyr/constants.rb +1 -1
- data/logstash-output-scalyr.gemspec +1 -1
- data/spec/logstash/outputs/scalyr_integration_spec.rb +14 -14
- data/spec/logstash/outputs/scalyr_spec.rb +0 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba6f9b828f98401b5f19e040e84f64a27de65fb6c41d4405c44b8038aac52450
|
4
|
+
data.tar.gz: 2aeed49b1518ea70df9f41bf4b627b748e23cd85104b45d96ce140d428220939
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
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.
|
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
|
-
|
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
|
508
|
-
@logger.
|
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
|
data/lib/scalyr/constants.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-output-scalyr'
|
3
|
-
s.version = '0.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(:
|
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(:
|
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(:
|
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(:
|
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(:
|
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(:
|
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(:
|
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(:
|
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
|
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
|
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(:
|
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(:
|
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(:
|
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(:
|
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.
|
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:
|
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
|