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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a3921be9c6e9f434524b03c140e94ca5de03128bbd9b27c9a9df67477ed79aa7
|
|
4
|
+
data.tar.gz: 90feef10dc4d4ada45acaefa06b65ea3cdc5543ba86beb5952f78b3167ec7948
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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(
|
|
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
|
|