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 +4 -4
- data/lib/plain_apm/agent.rb +6 -5
- data/lib/plain_apm/config.rb +1 -3
- data/lib/plain_apm/hooks/error_reporter.rb +2 -1
- data/lib/plain_apm/version.rb +1 -1
- data/lib/plain_apm.rb +7 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01732eb28831a79bda84629911827630f98d10e7650de6c19c99c652e86c7841
|
4
|
+
data.tar.gz: b6823be6751d685b6b3d8669d6eba23581586bcbfe1957a5d0b169bacea130b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1167958c799e9df78f1d906773cba2b63a17f07ed7a4412bbc27f4aaf65a594868cc76dde86e704311d312efb3ee4b68338ca8c4ee107e2a96a00a445ece115
|
7
|
+
data.tar.gz: '0857d37547502f6db950edbde4d1b3c10855cfaaa02bab04c17e2cde9a904f2f9df4bb22e85fb0a23aef8b52925df98e1a9eef88a86d7b9ce761005b12fe874f'
|
data/lib/plain_apm/agent.rb
CHANGED
@@ -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
|
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
|
data/lib/plain_apm/config.rb
CHANGED
@@ -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
|
-
|
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"
|
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
|
data/lib/plain_apm/version.rb
CHANGED
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
|
-
|
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.
|
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-
|
11
|
+
date: 2022-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|