plain_apm 0.9.8 → 0.10.0

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: 72d2d8915ce85d5a10557fd615a6011840b329155bc0d8765c1a5cef05383bc3
4
- data.tar.gz: e9473490d411042af5e1cc04d7374ebb6b8f7b5c07aebaaa0bda604ca0bfb3a2
3
+ metadata.gz: f234cdb0d7afa540ac0ae06405ca89a2476bf4e18a44062aebe6fda4868b8b63
4
+ data.tar.gz: 1c3b2039cd4ce11b9d26d23a1dda6c9fba208fb2e3e8c50bccb0947e1f0161da
5
5
  SHA512:
6
- metadata.gz: 7230625a30f50a3777ba5364544979b3edf1718b752836791b4c66997bb4988ca3e8311b1a11ddbefd8de4c0c80f2bae6761532fc0a08567d7b09b67d65a2062
7
- data.tar.gz: ff5e0376280f779a9ce2e4cd8cab148d61bf87c8280406b43a71aa409c63974d149afd727540774e564c9d383788d69b9cc533d90bd64849e86ff8f6763db536
6
+ metadata.gz: 7695a907666719056596c427615ca736b39e19a09ee5de97d6999eaec49a55b0a41853e6796076e5acc5e6433f3b8378cab802eadd682b27070b7e3bfe260a51
7
+ data.tar.gz: d2ce1c8a4e12681f661c3b09307a32211cfcb3e65d449bb00f90b995bdb5ed4d9726db2edc6722e1d4a9c97a2035d3b6cc1f75d3e1767bf6f0baacdcfba71a36
@@ -19,11 +19,11 @@ module PlainApm
19
19
  end
20
20
 
21
21
  def key_present?
22
- ENV["PLAIN_APM_APP_KEY"] != ""
22
+ ENV["PLAIN_APM_APP_KEY"].to_s != ""
23
23
  end
24
24
 
25
25
  def production?
26
- (ENV["RAILS_ENV"] || ENV["RACK_ENV"]) == "production"
26
+ (ENV["RAILS_ENV"] || ENV["RACK_ENV"] || ENV["APP_ENV"]) == "production"
27
27
  end
28
28
 
29
29
  def interactive?
@@ -16,7 +16,7 @@ module PlainApm
16
16
  end
17
17
 
18
18
  def heroku_revision
19
- rev = ENV["HEROKU_SLUG_COMMIT"].to_s[0..8]
19
+ rev = ENV.fetch("GIT_REV", ENV.fetch("HEROKU_SLUG_COMMIT", ""))[0...8]
20
20
  rev if !rev.empty?
21
21
  end
22
22
 
@@ -17,9 +17,9 @@ module PlainApm
17
17
  ].freeze
18
18
 
19
19
  def attributes_from_exception(e, context, error_source)
20
- source = "exception"
20
+ name = "exception"
21
21
 
22
- return [source, nil] if IGNORED_EXCEPTIONS.include?(e.class.name)
22
+ return [name, nil] if IGNORED_EXCEPTIONS.include?(e.class.name)
23
23
 
24
24
  attrs = context_attributes
25
25
 
@@ -67,7 +67,7 @@ module PlainApm
67
67
 
68
68
  add_trace_attributes(attrs)
69
69
 
70
- [source, attrs]
70
+ [name, attrs]
71
71
  end
72
72
 
73
73
  def attributes_from_notification(event)
@@ -25,12 +25,12 @@ module PlainApm
25
25
  private
26
26
 
27
27
  def report_exception(e, env)
28
- source, event = attributes_from_exception(e, {env: env}, nil)
28
+ name, event = attributes_from_exception(e, {env: env}, nil)
29
29
 
30
30
  return if event.nil?
31
31
 
32
- event[:source] = source
33
- event[:name] = "rack_middleware"
32
+ event[:source] = "rack_middleware"
33
+ event[:name] = name
34
34
 
35
35
  PlainApm.agent.collect(event)
36
36
  end
@@ -23,12 +23,12 @@ module PlainApm
23
23
  end
24
24
 
25
25
  def collect(e, handled:, severity:, context: {}, source: nil)
26
- event_source, event = attributes_from_exception(e, context, source)
26
+ name, event = attributes_from_exception(e, context, source)
27
27
 
28
28
  return if event.nil?
29
29
 
30
- event[:source] = event_source
31
- event[:name] = "error_reporter"
30
+ event[:source] = "error_reporter"
31
+ event[:name] = name
32
32
 
33
33
  ::PlainApm.agent.collect(event)
34
34
  end
@@ -92,7 +92,7 @@ module PlainApm
92
92
 
93
93
  {
94
94
  "Content-Type" => "application/json, charset=UTF-8",
95
- "Content-Encoding" => "gzip",
95
+ "Content-Encoding" => "deflate",
96
96
  "X-PlainApm-Key" => app_key
97
97
  }.merge(meta_headers)
98
98
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PlainApm
4
- VERSION = "0.9.8"
4
+ VERSION = "0.10.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plain_apm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.8
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - PlainAPM Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-04-08 00:00:00.000000000 Z
11
+ date: 2024-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest