logstash-output-edge_loki 1.0.5 → 1.0.7
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/lib/logstash/outputs/edge_loki.rb +11 -10
- data/logstash-output-edge_loki.gemspec +1 -1
- 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: b7815895543bbcb18b5a4b9383f083223f229713c537f336f48cc2cffd76fed7
|
4
|
+
data.tar.gz: d8d68d9291a738b47d4de30ec1d3c2a62894aae498dfb6869e14684d4cbebb37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
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 #{
|
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(
|
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
|
@@ -278,6 +278,7 @@ class LogStash::Outputs::EDGE_Loki < LogStash::Outputs::Base
|
|
278
278
|
@logger.info("createClient: started method")
|
279
279
|
client = OAuth2::Client.new(@client_id, @client_secret, site: @url)
|
280
280
|
client.auth_code.authorize_url(redirect_uri: @token_url)
|
281
|
+
@logger.info("createClient: started method", :client => client)
|
281
282
|
return client
|
282
283
|
end
|
283
284
|
|
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.
|
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-
|
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
|