rails-informant 0.2.0 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 23f6010e9d0fb78edf15e681c0abf536f62a0ff9cbf14d4e391a0e535c286835
4
- data.tar.gz: 0b3c5431f20c0466e17a344b8818e0703fc432d8c9f01eaaa53a99031cde782a
3
+ metadata.gz: a3921be9c6e9f434524b03c140e94ca5de03128bbd9b27c9a9df67477ed79aa7
4
+ data.tar.gz: 90feef10dc4d4ada45acaefa06b65ea3cdc5543ba86beb5952f78b3167ec7948
5
5
  SHA512:
6
- metadata.gz: 3522f4235d560a76b54806023b64e4e68f75f109bb6115f4f669cef90450c486f2bbefab67ebba1b6f220040e5964c9434d9cfb38b4a33e6e0fadd0115e86927
7
- data.tar.gz: 686b3b2b35f60d7bad57bac5918e8620b2d3f7b018de19bf6628091976af3204c1886cdee9c047df2658f621b8e71e5b8715f259979be0347d129b78af6d05c3
6
+ metadata.gz: caef8697007fb7a2c678f925db8366ebb6dd7d493f489cc87e7a099f57b8852238a5ca7949d133a11120be6dd6a9eda3535d4d62f60bf31a7ea81187d9b004f7
7
+ data.tar.gz: bc56bb6ca81812f771196081a70fade906ca1c4a8c4f047f6d63c326c87f67e941bbd05c0cc5c355898726ea6d6591b86fdbed72293bccfbb20dfffca6102c5b
@@ -11,7 +11,7 @@ module RailsInformant
11
11
  group = ErrorGroup.find_or_create_for(Fingerprint.generate(error), attrs)
12
12
  group.detect_regression!
13
13
  store_occurrence(group, error, env:, context:) if should_store_occurrence?(group)
14
- notify(group)
14
+ notify(group, error)
15
15
  rescue StandardError => e
16
16
  Rails.logger.error "[RailsInformant] Capture failed: #{e.class}: #{e.message}\n#{e.backtrace&.first(5)&.join("\n")}"
17
17
  end
@@ -38,10 +38,15 @@ module RailsInformant
38
38
  keep_ids = group.occurrences.order(created_at: :desc).limit(MAX_OCCURRENCES_PER_GROUP).select(:id)
39
39
  Occurrence.where(error_group_id: group.id).where.not(id: keep_ids).delete_all
40
40
  end
41
- def notify(group)
41
+ def notify(group, error)
42
+ return if notifier_error?(error)
42
43
  return unless RailsInformant.config.notifiers.any? { it.should_notify?(group) }
43
44
  RailsInformant::NotifyJob.perform_later group
44
45
  end
46
+
47
+ def notifier_error?(error)
48
+ error.backtrace&.any? { it.include?("rails_informant/notifiers") }
49
+ end
45
50
  end
46
51
  end
47
52
  end
@@ -52,9 +52,7 @@ module RailsInformant
52
52
  request = Net::HTTP::Post.new uri, { "Content-Type" => "application/json", "Host" => uri.hostname }.merge(headers)
53
53
  request.body = body.to_json
54
54
 
55
- response = Net::HTTP.start(resolved_ip, uri.port, use_ssl: true, open_timeout: 10, read_timeout: 15, max_retries: 0) do |http|
56
- http.verify_hostname = true
57
- http.hostname = uri.hostname # SNI: verify cert against hostname, connect to resolved IP
55
+ response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true, ipaddr: resolved_ip, open_timeout: 10, read_timeout: 15, max_retries: 0) do |http|
58
56
  http.request request
59
57
  end
60
58
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-informant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel López Prat