scout_apm 0.9.7.pre2 → 0.9.7.pre3
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 +4 -4
- data/lib/scout_apm/middleware.rb +14 -13
- data/lib/scout_apm/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25aab00b1c404c8862106f78cf50c6c1d8858c0a
|
4
|
+
data.tar.gz: 93f051bfce0749e1706ac6eb9f869c7b5c1020d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c909c0c8dd205dbb7602e2be3bda38d25a52c08e7bc4ac50839285ef01e24379de8aa154f6c7b561931ad3a35a6d8ac722c4c1544c778d60d6b745e8554bc3d1
|
7
|
+
data.tar.gz: 10769f5a0057b7ee12ab17629541861fe142739620d913e8f735eb2fad63f157ed815eeb27692f47281badd46c7ad765a10d631cbbdc6df046ee31dea3a3fc71
|
data/lib/scout_apm/middleware.rb
CHANGED
@@ -5,7 +5,7 @@ module ScoutApm
|
|
5
5
|
def initialize(app)
|
6
6
|
@app = app
|
7
7
|
@attempts = 0
|
8
|
-
@started =
|
8
|
+
@started = ScoutApm::Agent.instance.started?
|
9
9
|
end
|
10
10
|
|
11
11
|
# If we get a web request in, then we know we're running in some sort of app server
|
@@ -13,18 +13,19 @@ module ScoutApm
|
|
13
13
|
if @started || @attempts > MAX_ATTEMPTS
|
14
14
|
@app.call(env)
|
15
15
|
else
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
16
|
+
attempt_to_start_agent
|
17
|
+
@app.call(env)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def attempt_to_start_agent
|
22
|
+
@attempts += 1
|
23
|
+
ScoutApm::Agent.instance.start(:skip_app_server_check => true)
|
24
|
+
@started = ScoutApm::Agent.instance.started?
|
25
|
+
rescue => e
|
26
|
+
# Can't be sure of any logging here, so fall back to ENV var and STDOUT
|
27
|
+
if ENV["SCOUT_LOG_LEVEL"] == "debug"
|
28
|
+
STDOUT.puts "Failed to start via Middleware: #{e.message}\n\t#{e.backtrace.join("\n\t")}"
|
28
29
|
end
|
29
30
|
end
|
30
31
|
end
|
data/lib/scout_apm/version.rb
CHANGED