logstash-output-edge_loki 1.0.6 → 1.0.7

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: 96ad0689fab60285dcec67ecf8af27c56491d6d6432df70615a4bf4e8a3b3772
4
- data.tar.gz: 2ac60436522d4d133cb89b9af6fe67cc443092257fba60ad104cd3a2e3f613c4
3
+ metadata.gz: b7815895543bbcb18b5a4b9383f083223f229713c537f336f48cc2cffd76fed7
4
+ data.tar.gz: d8d68d9291a738b47d4de30ec1d3c2a62894aae498dfb6869e14684d4cbebb37
5
5
  SHA512:
6
- metadata.gz: e696333ac21b6b22cf62631eed79052ce05e0ec2febb69371c4827273124a4f7695becf05a9d9e843c33142ddf6518a8f4e69ff6e0c2bed51b42e8d00158ff1a
7
- data.tar.gz: 89b9e6fe0e6a3acacd8db5ca993085aad0c52e8720ea5748ad031e920b611da7e4b0b4ad0e1b52bb68025e51964cee8fd8a026ebf57343e35cc50705bb0657c1
6
+ metadata.gz: 4baf39cedf6a80af43190b002452d7565e1e1277de335aa708fd0533f76a527250ec90c420b1a643f7adf4c61d9dfe3216d9df4c10217aa926b126e703b504b1
7
+ data.tar.gz: 7fc3f6ad11def007015b2180ed15c663919babce9f36d5e69d1533751f2ebbf78325f8fb949c7f92c8cf90aadc072e428f478cbc8f8dc8c6e37592072f93aebe
@@ -224,9 +224,9 @@ class LogStash::Outputs::EDGE_Loki < LogStash::Outputs::Base
224
224
 
225
225
  def send(batch)
226
226
  @logger.info("send: started method")
227
- createClient()
227
+ client = createClient()
228
228
  payload = batch.to_json
229
- res = loki_http_request(payload)
229
+ res = loki_http_request(client, payload)
230
230
  if res.is_a?(Net::HTTPSuccess)
231
231
  @logger.debug("Successfully pushed data to loki")
232
232
  else
@@ -234,25 +234,25 @@ class LogStash::Outputs::EDGE_Loki < LogStash::Outputs::Base
234
234
  end
235
235
  end
236
236
 
237
- def loki_http_request(payload)
237
+ def loki_http_request(client, payload)
238
238
  @logger.info("loki_http_request: started method")
239
239
  req = Net::HTTP::Post.new(
240
240
  @uri.request_uri
241
241
  )
242
- req.add_field('Content-Type', 'application/json')
243
- req.add_field('X-Scope-OrgID', @tenant_id) if @tenant_id
244
- req['User-Agent']= 'loki-logstash'
245
- req.basic_auth(@client_id, @client_secret) if @client_id
246
- req.body = payload
242
+ client.add_field('Content-Type', 'application/json')
243
+ client.add_field('X-Scope-OrgID', @tenant_id) if @tenant_id
244
+ client['User-Agent']= 'loki-logstash'
245
+ client.basic_auth(@client_id, @client_secret) if @client_id
246
+ client.body = payload
247
247
 
248
248
  opts = ssl_opts(@uri)
249
249
 
250
- @logger.debug("sending #{req.body.length} bytes to loki")
250
+ @logger.debug("sending #{client.body.length} bytes to loki")
251
251
  retry_count = 0
252
252
  delay = @min_delay
253
253
  begin
254
254
  res = Net::HTTP.start(@uri.host, @uri.port, **opts) { |http|
255
- http.request(req)
255
+ http.request(client)
256
256
  }
257
257
  return res if !res.nil? && res.code.to_i != 429 && res.code.to_i.div(100) != 5
258
258
  raise StandardError.new res
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-edge_loki'
3
- s.version = '1.0.6'
3
+ s.version = '1.0.7'
4
4
  s.authors = ['Britto Prabhu']
5
5
  s.email = ['britto.prabhu@apmterminals.com']
6
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-edge_loki
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Britto Prabhu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-03 00:00:00.000000000 Z
11
+ date: 2023-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement