scout_apm 0.9.7.pre1 → 0.9.7.pre2

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
  SHA1:
3
- metadata.gz: 5553499d4799713d432a418bc069de3d15ca85af
4
- data.tar.gz: cca7067b29444e55b7d18b8e5dd2aa5cb3558c54
3
+ metadata.gz: 5aec62477f0a794720ae3147888ae6525f3c5fcd
4
+ data.tar.gz: 0348a870ef42aebc7a2ef2a5c82488d5c93e489b
5
5
  SHA512:
6
- metadata.gz: 8e5d4149e7610061f72e683aad7f973e6d17a0a78d062fbd0f43d21021b040f2f48af6018d7c4e73676b5e09849021f3f53e0ba0e09461030bc5ad1f3da3623b
7
- data.tar.gz: 84c8eec2f42d245e8bc19ff816c576cfb4a8cabb96a77602b90ac0c3ccabaafb098f39da7ece6205e4e3464155110202a84afd8b822fb4df25e6f789756fdc44
6
+ metadata.gz: f8625d4209e97a51f1411e39689887841670653546d3ad281a6d1eccbb1f5429ee74249439a0c519beb74f84feee0510772889d0bbff9f379e2bf95003716989
7
+ data.tar.gz: 1d3c8307e2f34b95fe13a00e77a2a22edc786efcf8a60bc5c3bfba54779ec911e20ca3ce3b59b834e379b49be619e6c92680bbc5ad87f0b4d0c5ce105d85468f
@@ -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}")
@@ -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
- ScoutApm::Agent.instance.start(:skip_app_server_check => true) unless @started
11
-
12
- @started = true
13
- @app.call(env)
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
@@ -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
 
@@ -1,4 +1,4 @@
1
1
  module ScoutApm
2
- VERSION = "0.9.7.pre1"
2
+ VERSION = "0.9.7.pre2"
3
3
  end
4
4
 
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.pre1
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-08 00:00:00.000000000 Z
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.4.8
154
+ rubygems_version: 2.2.2
155
155
  signing_key:
156
156
  specification_version: 4
157
157
  summary: Ruby application performance monitoring