flexciton-logstash-output-opsgenie 1.0.1 → 2.0.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
2
  SHA256:
3
- metadata.gz: 51221cc7c51172f6767f4e452a6b44f6a254aa2f496705d7a556c6f8ccfeb92b
4
- data.tar.gz: fe02f65c8a1c9d763b9d2fa88d726fba01856fa156cf59eedc0a99e59fab5189
3
+ metadata.gz: 34a1e3ca52554902ba67056b1359f82ae6d1a5e92bd0cf5dd5b2862b22822a1c
4
+ data.tar.gz: 175bd9c7866726b5c466cbaaee1bca001b3ebe5f3915e058f3ed5f5bdbb25c5f
5
5
  SHA512:
6
- metadata.gz: ab3bc1b5c0a2a1b4754d1e8704ed50562a6475cd1ff321cfdbb7609921a2f9e38f7f62489f1f1756cf4f42c998439de9c22542028feb8c764fdbd9c440271a07
7
- data.tar.gz: b5653029c750dcc3e71641c3c7d097be87964c38400abb6a44668968cdc0920668d73dd8fc61e6663eceafb2ee9fb9ccaa95d1b6daa92a8fe692a46ea6ce5202
6
+ metadata.gz: f6157fb6cc89687064bd9dbce6ff6d88f5988f5fe889e9afe202542d78056574d4e430ed30dff22abbb86f41bd6d9be2774d4d6a15c8014af383eb956aae0e18
7
+ data.tar.gz: c11dd7a785043177b0eb95e2aa112fffcb81d2abbd9d925d33d7f64d2e2b8f2235c4138530dfd0d5ff65a61fe4446ac89ed8dd87fb6e3266de00605d1660e9e8
@@ -7,10 +7,11 @@ require "net/http"
7
7
  require "net/https"
8
8
 
9
9
 
10
- HTTP_EXCEPTIONS = [
10
+ CATCHABLE_EXCEPTIONS = [
11
11
  Errno::EINVAL,
12
12
  Net::HTTPBadResponse,
13
13
  Net::HTTPHeaderSyntaxError,
14
+ JSON::ParserError,
14
15
  ]
15
16
 
16
17
  RETRYABLE_HTTP_EXCEPTIONS = [
@@ -204,7 +205,11 @@ class LogStash::Outputs::OpsGenie < LogStash::Outputs::Base
204
205
  )
205
206
  request.body = params.to_json
206
207
  response = http.request(request)
207
- rescue *HTTP_EXCEPTIONS => e
208
+
209
+ body = response.body
210
+ body = JSON.parse(body)
211
+ @logger.warn("Executed [#{uri}]. Response:[#{body}]")
212
+ rescue *CATCHABLE_EXCEPTIONS => e
208
213
  @logger.warn("Silencing exception in logstash opsgenie outputs: [#{e.class}: #{e.message}]")
209
214
  return
210
215
  rescue *RETRYABLE_HTTP_EXCEPTIONS => e
@@ -221,9 +226,6 @@ class LogStash::Outputs::OpsGenie < LogStash::Outputs::Base
221
226
  end
222
227
  end
223
228
 
224
- body = response.body
225
- body = JSON.parse(body)
226
- @logger.warn("Executed [#{uri}]. Response:[#{body}]")
227
229
  end
228
230
  end # def executePost
229
231
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'flexciton-logstash-output-opsgenie'
3
- s.version = '1.0.1'
3
+ s.version = '2.0.0'
4
4
  s.licenses = ["Apache-2.0"]
5
5
  s.summary = "Flexciton Logstash Output Opsgenie plugin allows creation, closing, acknowledging and adding notes to alerts in OpsGenie."
6
6
  s.description = "Install this gem on your Logstash instance with: $LS_HOME/bin/logstash-plugin install flexciton-logstash-output-opsgenie. Includes retry and silencing mechanism for network errors."
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flexciton-logstash-output-opsgenie
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flexciton Ltd, Tomasz Kluczkowski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-03 00:00:00.000000000 Z
11
+ date: 2024-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement