scout_apm 0.9.7.pre1 → 0.9.7.pre2
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/CHANGELOG.markdown +3 -0
- data/lib/scout_apm/agent/reporting.rb +2 -1
- data/lib/scout_apm/middleware.rb +19 -4
- data/lib/scout_apm/reporter.rb +2 -1
- data/lib/scout_apm/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5aec62477f0a794720ae3147888ae6525f3c5fcd
|
|
4
|
+
data.tar.gz: 0348a870ef42aebc7a2ef2a5c82488d5c93e489b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f8625d4209e97a51f1411e39689887841670653546d3ad281a6d1eccbb1f5429ee74249439a0c519beb74f84feee0510772889d0bbff9f379e2bf95003716989
|
|
7
|
+
data.tar.gz: 1d3c8307e2f34b95fe13a00e77a2a22edc786efcf8a60bc5c3bfba54779ec911e20ca3ce3b59b834e379b49be619e6c92680bbc5ad87f0b4d0c5ce105d85468f
|
data/CHANGELOG.markdown
CHANGED
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
* Added Cloud Foundry detection
|
|
4
4
|
* Added hostname config option
|
|
5
5
|
* Reporting PaaS in app server load (Heroku or Cloud Foundry).
|
|
6
|
+
* Fallback to a middleware to launch the agent if we can't detect the
|
|
7
|
+
application server for any reason
|
|
8
|
+
* Added agent version to checkin data
|
|
6
9
|
|
|
7
10
|
# 0.9.6
|
|
8
11
|
|
|
@@ -33,7 +33,8 @@ module ScoutApm
|
|
|
33
33
|
|
|
34
34
|
metadata = {
|
|
35
35
|
:app_root => ScoutApm::Environment.instance.root.to_s,
|
|
36
|
-
:unique_id => ScoutApm::Utils::UniqueId.simple
|
|
36
|
+
:unique_id => ScoutApm::Utils::UniqueId.simple,
|
|
37
|
+
:agent_version => ScoutApm::VERSION,
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
logger.debug("Metrics: #{metrics}")
|
data/lib/scout_apm/middleware.rb
CHANGED
|
@@ -1,16 +1,31 @@
|
|
|
1
1
|
module ScoutApm
|
|
2
2
|
class Middleware
|
|
3
|
+
MAX_ATTEMPTS = 5
|
|
4
|
+
|
|
3
5
|
def initialize(app)
|
|
4
6
|
@app = app
|
|
7
|
+
@attempts = 0
|
|
5
8
|
@started = false
|
|
6
9
|
end
|
|
7
10
|
|
|
8
11
|
# If we get a web request in, then we know we're running in some sort of app server
|
|
9
12
|
def call(env)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
if @started || @attempts > MAX_ATTEMPTS
|
|
14
|
+
@app.call(env)
|
|
15
|
+
else
|
|
16
|
+
begin
|
|
17
|
+
@attempts += 1
|
|
18
|
+
ScoutApm::Agent.instance.start(:skip_app_server_check => true)
|
|
19
|
+
@started = ScoutApm::Agent.instance.started?
|
|
20
|
+
rescue => e
|
|
21
|
+
# Can't be sure of any logging here, so fall back to ENV var and STDOUT
|
|
22
|
+
if ENV["SCOUT_LOG_LEVEL"] == "debug"
|
|
23
|
+
STDOUT.puts "Failed to start via Middleware: #{e.message}\n\t#{e.backtrace.join("\n\t")}"
|
|
24
|
+
end
|
|
25
|
+
ensure
|
|
26
|
+
@app.call(env)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
14
29
|
end
|
|
15
30
|
end
|
|
16
31
|
end
|
data/lib/scout_apm/reporter.rb
CHANGED
|
@@ -83,7 +83,8 @@ module ScoutApm
|
|
|
83
83
|
# Headers passed up with all API requests.
|
|
84
84
|
def default_http_headers
|
|
85
85
|
{ "Agent-Hostname" => ScoutApm::Environment.instance.hostname,
|
|
86
|
-
"Content-Type" => "application/octet-stream"
|
|
86
|
+
"Content-Type" => "application/octet-stream",
|
|
87
|
+
"Agent-Version" => ScoutApm::VERSION,
|
|
87
88
|
}
|
|
88
89
|
end
|
|
89
90
|
|
data/lib/scout_apm/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: scout_apm
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.9.7.
|
|
4
|
+
version: 0.9.7.pre2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Derek Haynes
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2015-11-
|
|
12
|
+
date: 2015-11-09 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: minitest
|
|
@@ -151,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
151
151
|
version: 1.3.1
|
|
152
152
|
requirements: []
|
|
153
153
|
rubyforge_project: scout_apm
|
|
154
|
-
rubygems_version: 2.
|
|
154
|
+
rubygems_version: 2.2.2
|
|
155
155
|
signing_key:
|
|
156
156
|
specification_version: 4
|
|
157
157
|
summary: Ruby application performance monitoring
|