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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '08332207f354cf7e2c4a6d323fd7d9641622b1a0f3d458117d229506011ce719'
4
- data.tar.gz: 108516196622ab56ef6b9c86c891bb68ebd80947897ed2dc1d8e8c23893fb50c
3
+ metadata.gz: 474cfba6967ab1b3109dc47be8ed80a292957f09286015fd9506d44d9d72548c
4
+ data.tar.gz: 17f42ddff7a84cacc24795468ba105a0622f7f5554324d717bf4d5f61618dd6b
5
5
  SHA512:
6
- metadata.gz: 9ace4d38fa8fdda5b0d0722a3536bc39964366e41ac51fdedf9ddd2588fed2bbdc15bb9eea6ebdec1b33394faf3e3f15c72a2750f320d886782a6dd53b7f09bf
7
- data.tar.gz: 36c241db3336f385aff44926ac495ad1f2c4599b756490c4195418244054589aac6b30c87411dbd3873c6cd7ce6f20ba48bd733d890c538b8a43a0c7a0969887
6
+ metadata.gz: f1285fe2fc85df206d20315fd0f549190d856035410bc86267eac3e6da169bbd33b8fa2bc08dd9c7f6612189239ca44b0896ae6390b858d0ecaebfd8ae5a724b
7
+ data.tar.gz: e387e7e3a92cd452fa4fa57cfe8b1c7fb26093436aada5d8a7e6a368bb302bea789f8e617e376d6ee1a7a8b900c3ccf334705656d2f9540a00151bc7ae00d7ba
@@ -1,3 +1,9 @@
1
+ ## 0.3.1
2
+ - Make sure that we can disable retries
3
+
4
+ ## 0.3.0
5
+ - Added support for proxy settings
6
+
1
7
  ## 0.2.1
2
8
  - Fixed a bug where logs would be truncated at 16kB
3
9
 
data/README.md CHANGED
@@ -20,7 +20,6 @@ output {
20
20
  api_key => "<DATADOG_API_KEY>"
21
21
  }
22
22
  }
23
-
24
23
  ```
25
24
 
26
25
  ## Need Help?
@@ -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
- if retries < max_retries
34
- if retries > 0
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
- # close connection and always retry
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 += 1
51
- retry
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.0'
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/'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-datadog_logs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Datadog