fluent-plugin-logzio 0.0.22 → 0.1.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
- SHA1:
3
- metadata.gz: f6e13567cce456b4bf9efe5ec2fcc72d9ab50648
4
- data.tar.gz: 9c92ef500e341c040349be13f9ac4d2ea8a3ea96
2
+ SHA256:
3
+ metadata.gz: de65dcc352aca420ba2469b1c31c0c3f135309b7728d501ca1eb27e09259e322
4
+ data.tar.gz: b92016ff7b59405e6e9d45b24ae87fb0d60d396b06bc6ae81b681991d45a56ea
5
5
  SHA512:
6
- metadata.gz: '09062c96178f0d3b42b2e5c9ace511b029ae3508e3beca477916b80b806e83f6ccb15bf94ce52eabebc2cce3e5a10d4b1009cf0c26e13752259578dac0e35479'
7
- data.tar.gz: b84d592569e502023fb318fbe2f1408a9049156740233ab67aeca0b0c0333a5c8ca39cf79eb641494fde4c9326fa28b65ae472feecea8724418243906dceed32
6
+ metadata.gz: f167bd4d0d6c60612dff909d2490d734808eb07894c7396af321351ae741c8fc9b60193209ff92819a50f74089c4d72f91bf24393e27f74a2da3246fef22d5a3
7
+ data.tar.gz: ccb0be4ca90d64ac4626adc6efbc05f46fde74bad6b505535c298f6b824a6e4e8d349a21128cddd211c212f730f9501c75b76c5f9c02efed096ea05e44a967de
@@ -0,0 +1,8 @@
1
+ repos:
2
+ - repo: https://github.com/cycodehq-public/cycode-cli
3
+ rev: 0.1.6
4
+ hooks:
5
+ - id: cycode
6
+ language_version: python3
7
+ stages:
8
+ - commit
data/README.md CHANGED
@@ -69,12 +69,14 @@ This is an **example** only. Your needs in production may vary!
69
69
  * **retry_sleep** How long to sleep initially between retries, exponential step-off. Initial default is 2s.
70
70
  * **bulk_limit** Limit to the size of the Logz.io upload bulk. Defaults to 1000000 bytes leaving about 24kB for overhead.
71
71
  * **bulk_limit_warning_limit** Limit to the size of the Logz.io warning message when a record exceeds bulk_limit to prevent a recursion when Fluent warnings are sent to the Logz.io output. Defaults to nil (no truncation).
72
- * **proxy_uri** Your proxy uri. Default is nil
72
+ * **proxy_uri** Your proxy uri. Default is nil. For example: "`my.ip:12345`".
73
73
  * **proxy_cert** Your proxy cert. Default is nil
74
74
  * **gzip** should the plugin ship the logs in gzip compression. Default is false
75
75
 
76
76
 
77
77
  ## Release Notes
78
+ - **0.1.0**:
79
+ - Use fluentd's retry instead of retry in code (raise exception on non-2xx response).
78
80
  - 0.0.22: Update gem `net-http-persistent` to 4.x.
79
81
  - 0.0.21: Update gem `net-http-persistent` to 3.x.
80
82
  - 0.0.20: Support gzip compression
@@ -4,8 +4,8 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = 'fluent-plugin-logzio'
7
- s.version = '0.0.22'
8
- s.authors = ['Yury Kotov', 'Roi Rav-Hon', 'Arcadiy Ivanov', 'Miri Ignatiev']
7
+ s.version = '0.1.0'
8
+ s.authors = ['Yury Kotov', 'Roi Rav-Hon', 'Arcadiy Ivanov', 'Miri Bar']
9
9
  s.email = ['bairkan@gmail.com', 'roi@logz.io', 'arcadiy@ivanov.biz', 'miri.ignatiev@logz.io']
10
10
  s.homepage = 'https://github.com/logzio/fluent-plugin-logzio'
11
11
  s.summary = %q{Fluentd plugin for output to Logz.io}
@@ -131,45 +131,21 @@ module Fluent::Plugin
131
131
  if gzip
132
132
  post.body = compress(post.body)
133
133
  end
134
- sleep_interval = @retry_sleep
135
134
 
136
135
  begin
137
- @retry_count.times do |counter|
138
- should_retry = true
139
- begin
140
- response = @http.request @uri, post
141
- if response.code != '200'
142
- if response.code == '401'
143
- log.error "You are not authorized with Logz.io! Token OK? dropping logs..."
144
- should_retry = false
145
- elsif response.code == '400'
146
- log.info "Got 400 code from Logz.io. This means that some of your logs are too big, or badly formatted. Response: #{response.body}"
147
- should_retry = false
148
- else
149
- log.warn "Got HTTP #{response.code} from Logz.io, not giving up just yet (Try #{counter + 1}/#{@retry_count})"
150
- end
151
- else
152
- log.debug "Successfully sent bulk of #{bulk_records.size} records, size #{bulk_size}B to Logz.io"
153
- should_retry = false
154
- end
155
- rescue StandardError => e
156
- log.warn "Error connecting to Logz.io. Got exception: #{e} (Try #{counter + 1}/#{@retry_count})"
157
- end
136
+ response = @http.request @uri, post
137
+ rescue Net::HTTP::Persistent::Error => e
138
+ raise e.cause
139
+ end
158
140
 
159
- if should_retry
160
- if counter == @retry_count - 1
161
- log.error "Could not send your bulk after #{retry_count} tries Sorry! Your bulk is: #{post.body}"
162
- break
163
- end
164
- sleep(sleep_interval)
165
- sleep_interval *= 2
166
- else
167
- return
168
- end
169
- end
170
- rescue Exception => e
171
- log.error "Got unexpected exception! Here: #{e}"
141
+ resp_err = response.code.to_s.start_with?('4') || response.code.to_s.start_with?('5')
142
+
143
+ if not response.code.start_with?('2')
144
+ log.debug "Failed request body: #{post.body}"
145
+ log.error "Error while sending POST to #{@uri}: #{response.body}"
172
146
  end
147
+
148
+ raise "Logzio listener returned (#{response.code}) for #{@uri}: #{response.body}" if resp_err
173
149
  end
174
150
 
175
151
  def compress(string)
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-logzio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.22
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yury Kotov
8
8
  - Roi Rav-Hon
9
9
  - Arcadiy Ivanov
10
- - Miri Ignatiev
10
+ - Miri Bar
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2022-06-19 00:00:00.000000000 Z
14
+ date: 2023-05-01 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: net-http-persistent
@@ -113,8 +113,8 @@ executables: []
113
113
  extensions: []
114
114
  extra_rdoc_files: []
115
115
  files:
116
- - ".github/workflows/git-secrets.yml"
117
116
  - ".gitignore"
117
+ - ".pre-commit-config.yaml"
118
118
  - ".rspec"
119
119
  - ".whitesource"
120
120
  - Gemfile
@@ -146,8 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
146
  - !ruby/object:Gem::Version
147
147
  version: '0'
148
148
  requirements: []
149
- rubyforge_project: fluent-plugin-logzio
150
- rubygems_version: 2.5.2.3
149
+ rubygems_version: 3.0.3.1
151
150
  signing_key:
152
151
  specification_version: 4
153
152
  summary: Fluentd plugin for output to Logz.io
@@ -1,33 +0,0 @@
1
- name: git-secrets
2
-
3
- # Controls when the workflow will run
4
- # Triggers the workflow on push or pull request events but only for the main branch
5
- on: [push]
6
-
7
- # A workflow run is made up of one or more jobs that can run sequentially or in parallel
8
- jobs:
9
- # This workflow contains a single job called "main"
10
- git-secrets:
11
- # The type of runner that the job will run on
12
- runs-on: ubuntu-18.04
13
-
14
- # Steps represent a sequence of tasks that will be executed as part of the job
15
- steps:
16
- - name: Check Out Source Code
17
- uses: actions/checkout@v2
18
-
19
- - name: Set up Python 3.8
20
- uses: actions/setup-python@v2
21
- with:
22
- python-version: 3.8
23
- - name: Installing dependencies
24
- run:
25
- sudo apt-get install git less openssh-server
26
- - name: Installing scanning tool
27
- run: |
28
- brew install git-secrets
29
- git secrets --install
30
- git secrets --register-aws
31
- - name: Running scanning tool
32
- run:
33
- git secrets --scan