logstash-output-datadog_logs 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +0 -1
- data/lib/logstash/outputs/datadog_logs.rb +12 -16
- data/logstash-output-datadog_logs.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 474cfba6967ab1b3109dc47be8ed80a292957f09286015fd9506d44d9d72548c
|
4
|
+
data.tar.gz: 17f42ddff7a84cacc24795468ba105a0622f7f5554324d717bf4d5f61618dd6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1285fe2fc85df206d20315fd0f549190d856035410bc86267eac3e6da169bbd33b8fa2bc08dd9c7f6612189239ca44b0896ae6390b858d0ecaebfd8ae5a724b
|
7
|
+
data.tar.gz: e387e7e3a92cd452fa4fa57cfe8b1c7fb26093436aada5d8a7e6a368bb302bea789f8e617e376d6ee1a7a8b900c3ccf334705656d2f9540a00151bc7ae00d7ba
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -28,27 +28,23 @@ class LogStash::Outputs::DatadogLogs < LogStash::Outputs::Base
|
|
28
28
|
require "socket"
|
29
29
|
client = nil
|
30
30
|
@codec.on_event do |event, payload|
|
31
|
+
message = "#{@api_key} #{payload}\n"
|
31
32
|
retries = 0
|
33
|
+
backoff = 1
|
32
34
|
begin
|
33
|
-
|
34
|
-
|
35
|
-
backoff = 2 ** retries
|
36
|
-
backoff = max_backoff unless backoff < max_backoff
|
37
|
-
sleep backoff
|
38
|
-
end
|
39
|
-
client ||= new_client
|
40
|
-
message = "#{@api_key} #{payload}\n"
|
41
|
-
client.write(message)
|
42
|
-
else
|
43
|
-
@logger.warn("Max number of retries reached, dropping the payload", :payload => payload)
|
44
|
-
end
|
35
|
+
client ||= new_client
|
36
|
+
client.write(message)
|
45
37
|
rescue => e
|
46
|
-
|
47
|
-
@logger.warn("Could not send message, retrying", :exception => e, :backtrace => e.backtrace)
|
38
|
+
@logger.warn("Could not send payload", :exception => e, :backtrace => e.backtrace)
|
48
39
|
client.close rescue nil
|
49
40
|
client = nil
|
50
|
-
retries
|
51
|
-
|
41
|
+
if retries < max_retries || max_retries < 0
|
42
|
+
sleep backoff
|
43
|
+
backoff = 2 * backoff unless backoff > max_backoff
|
44
|
+
retries += 1
|
45
|
+
retry
|
46
|
+
end
|
47
|
+
@logger.warn("Max number of retries reached, dropping the payload", :payload => payload, :max_retries => max_retries)
|
52
48
|
end
|
53
49
|
end
|
54
50
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-output-datadog_logs'
|
3
|
-
s.version = '0.3.
|
3
|
+
s.version = '0.3.1'
|
4
4
|
s.licenses = ['Apache-2.0']
|
5
5
|
s.summary = 'DatadogLogs lets you send logs to Datadog based on LogStash events.'
|
6
6
|
s.homepage = 'https://www.datadoghq.com/'
|