plain_apm 0.5.1 → 0.5.2

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: 00f09f66ee2dc9a76789adbfa6bb4634427a2c32c57780b131057f614782127e
4
+ data.tar.gz: b66dc9db7fbbd925da8d4e96412ba54dc09019046db3ebde26da7944918f481b
5
5
  SHA512:
6
- metadata.gz: 1f27b3d576b02f43a190a2c98054c06ed85f562801ed71e47b4e0969b636a7d7c1197dec61203b0c7ea3bae727272069224085ef07258ae216101df135831f89
7
- data.tar.gz: bf82ba5a3e6276bca9b763032b93a4ecc272eb6d112cad0c760b95952be580298540280827fc192b7e945e737be8b019fd2f986218bbcddd08720addd5e5e983
6
+ metadata.gz: 144ab0a7599e0628ba9ab691c81a4c7af92949bed28f3cfbcd89e6e36c052e636a8339a0eebbafe69725476c5e350e97bed6e4911e19100e4bbf2bbd89fa5aba
7
+ data.tar.gz: 7f4dca1052f789f92c3b3aa991681ced8492bb443d45acacf4dfeab46237d9b539a56f1ff607fcfad3549c4421c9871978296266850244f96dffd6bc579e0121
@@ -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
@@ -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.2"
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.2
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-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest