plain_apm 0.5.1 → 0.5.3

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: 279338102fbc7e827cc33a707aeafee949af9668fca997dbaabaa3de3555c3b6
4
- data.tar.gz: 54c65a431b2ed06d58444c1a8a178f5f80105f3d7383586c1ffec184d46c1e58
3
+ metadata.gz: 01732eb28831a79bda84629911827630f98d10e7650de6c19c99c652e86c7841
4
+ data.tar.gz: b6823be6751d685b6b3d8669d6eba23581586bcbfe1957a5d0b169bacea130b3
5
5
  SHA512:
6
- metadata.gz: 1f27b3d576b02f43a190a2c98054c06ed85f562801ed71e47b4e0969b636a7d7c1197dec61203b0c7ea3bae727272069224085ef07258ae216101df135831f89
7
- data.tar.gz: bf82ba5a3e6276bca9b763032b93a4ecc272eb6d112cad0c760b95952be580298540280827fc192b7e945e737be8b019fd2f986218bbcddd08720addd5e5e983
6
+ metadata.gz: d1167958c799e9df78f1d906773cba2b63a17f07ed7a4412bbc27f4aaf65a594868cc76dde86e704311d312efb3ee4b68338ca8c4ee107e2a96a00a445ece115
7
+ data.tar.gz: '0857d37547502f6db950edbde4d1b3c10855cfaaa02bab04c17e2cde9a904f2f9df4bb22e85fb0a23aef8b52925df98e1a9eef88a86d7b9ce761005b12fe874f'
@@ -36,11 +36,15 @@ module PlainApm
36
36
  "thread_id" => Thread.current.object_id.to_s,
37
37
  )
38
38
 
39
- @events << event
39
+ @events << event
40
40
  end
41
41
 
42
42
  def start
43
+ # Already running
43
44
  return unless @publisher.nil?
45
+
46
+ configure
47
+
44
48
  return unless @config.enabled
45
49
 
46
50
  # TODO: sized queue w/ a timeout.
@@ -57,11 +61,8 @@ module PlainApm
57
61
 
58
62
  private
59
63
 
60
- def initialize
61
- # TODO: validate config
64
+ def configure
62
65
  @config = Config.new
63
-
64
- super
65
66
  end
66
67
 
67
68
  def install_hooks
@@ -11,9 +11,7 @@ module PlainApm
11
11
  @endpoint = ENV["PLAIN_APM_ENDPOINT"] || DEFAULT_EVENT_ENDPOINT
12
12
  @app_key = ENV["PLAIN_APM_APP_KEY"]
13
13
 
14
- if enabled? && !key_present?
15
- warn("Missing PLAIN_APM_APP_KEY environment variable, plain_apm agent won't start.")
16
- end
14
+ warn("PlainAPM agent enabled.") if enabled
17
15
  end
18
16
 
19
17
  private
@@ -3,7 +3,8 @@ module PlainApm
3
3
  # Rails 7 error notification mechanism
4
4
  class ErrorReporter
5
5
  IGNORED_EXCEPTIONS = [
6
- "Sidekiq::JobRetry::Skip" # Sidekiq uses exceptions for control flow.
6
+ "Sidekiq::JobRetry::Skip", # Sidekiq uses exceptions for control flow.
7
+ "ActionController::RoutingError" # Rails unmapped route, raised before the request hits the app.
7
8
  ].freeze
8
9
 
9
10
  def install
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PlainApm
4
- VERSION = "0.5.1"
4
+ VERSION = "0.5.3"
5
5
  end
data/lib/plain_apm.rb CHANGED
@@ -38,5 +38,11 @@ require_relative "plain_apm/hooks/manual"
38
38
  require_relative "plain_apm/hooks/error_reporter"
39
39
 
40
40
  module PlainApm
41
- Agent.start
41
+ if defined?(Rails)
42
+ class Railtie < Rails::Railtie
43
+ config.after_initialize { PlainApm::Agent.start }
44
+ end
45
+ else
46
+ Agent.start
47
+ end
42
48
  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.5.1
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - PlainAPM Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-04 00:00:00.000000000 Z
11
+ date: 2022-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest