scout_apm 0.9.2.2 → 0.9.3pre1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 270bf16cf2be02cef0bfc11f628da5dbae7a8efc
4
- data.tar.gz: c6194a663576500dbfbc2eda60ac30ede43cb24f
3
+ metadata.gz: 9f2a25966bed125bef4e5af063ba90cc73512786
4
+ data.tar.gz: 23abb02567200410a1cc02be33306f1e3746142d
5
5
  SHA512:
6
- metadata.gz: 37e428f93c79c5eac815b69f9a5d3ed8f8034abbaa0ff8aa6a2c98e7fe093a5b7a6244ce868bd46c1512e104cf55d88a4d84cb49274ca373f27bce85fa67dda0
7
- data.tar.gz: 17d50f933f9a33f99b5f53055eeb39304a8e1f518546525b654b52adce62ec07ff5e687359953c80e007f9a1a2865e17cd4ce387670917dcdb0f1871dbbf7631
6
+ metadata.gz: 464b22471dcf5e9fa9d76d9396d590a3c9ab7343c8b99962a43c209da4e3735dfcaabda0356c5d0386c2beb752109a186479d6e01745de31f9992318df6d9230
7
+ data.tar.gz: 0d86312dfa978d54a527684f42726bcd803bd9c54ac7ab92014e361288d258b3cb82adc28605b1591dc4a783f9b7d478bd383091c4b0d8e9bf22d5c4fb1a0d66
data/lib/scout_apm.rb CHANGED
@@ -59,6 +59,7 @@ require 'scout_apm/utils/sql_sanitizer'
59
59
  require 'scout_apm/utils/null_logger'
60
60
  require 'scout_apm/utils/installed_gems'
61
61
  require 'scout_apm/utils/time'
62
+ require 'scout_apm/utils/unique_id'
62
63
 
63
64
  require 'scout_apm/config'
64
65
  require 'scout_apm/environment'
@@ -33,8 +33,12 @@ module ScoutApm
33
33
 
34
34
  logger.debug("Metrics: #{metrics}")
35
35
  logger.debug("SlowTrans: #{slow_transactions}")
36
+ metadata = {
37
+ app_root: ScoutApm::Environment.instance.root,
38
+ unique_id: ScoutApm::Utils::UniqueId.simple
39
+ }
36
40
 
37
- payload = ScoutApm::Serializers::PayloadSerializer.serialize(metrics, slow_transactions)
41
+ payload = ScoutApm::Serializers::PayloadSerializer.serialize(metadata, metrics, slow_transactions)
38
42
  slow_transactions_kb = Marshal.dump(slow_transactions).size/1024 # just for performance debugging
39
43
 
40
44
  logger.info "Delivering #{metrics.length} Metrics for #{total_request_count} requests and #{slow_transactions.length} Slow Transaction Traces"
@@ -7,14 +7,19 @@ module ScoutApm
7
7
 
8
8
  # I've put Thin and Webrick last as they are often used in development and included in Gemfiles
9
9
  # but less likely used in production.
10
+ STDOUT_LOGGER = begin
11
+ l = Logger.new(STDOUT)
12
+ l.level = Agent.instance.config.value("log_level", true) || Logger::INFO
13
+ end
14
+
10
15
  SERVER_INTEGRATIONS = [
11
- ScoutApm::ServerIntegrations::Passenger.new(Logger.new(STDOUT)),
12
- ScoutApm::ServerIntegrations::Unicorn.new(Logger.new(STDOUT)),
13
- ScoutApm::ServerIntegrations::Rainbows.new(Logger.new(STDOUT)),
14
- ScoutApm::ServerIntegrations::Puma.new(Logger.new(STDOUT)),
15
- ScoutApm::ServerIntegrations::Thin.new(Logger.new(STDOUT)),
16
- ScoutApm::ServerIntegrations::Webrick.new(Logger.new(STDOUT)),
17
- ScoutApm::ServerIntegrations::Null.new(Logger.new(STDOUT)), # must be last
16
+ ScoutApm::ServerIntegrations::Passenger.new(STDOUT_LOGGER),
17
+ ScoutApm::ServerIntegrations::Unicorn.new(STDOUT_LOGGER),
18
+ ScoutApm::ServerIntegrations::Rainbows.new(STDOUT_LOGGER),
19
+ ScoutApm::ServerIntegrations::Puma.new(STDOUT_LOGGER),
20
+ ScoutApm::ServerIntegrations::Thin.new(STDOUT_LOGGER),
21
+ ScoutApm::ServerIntegrations::Webrick.new(STDOUT_LOGGER),
22
+ ScoutApm::ServerIntegrations::Null.new(STDOUT_LOGGER), # must be last
18
23
  ]
19
24
 
20
25
  FRAMEWORK_INTEGRATIONS = [
@@ -25,8 +30,8 @@ module ScoutApm
25
30
  ]
26
31
 
27
32
  DEPLOY_INTEGRATIONS = [
28
- ScoutApm::DeployIntegrations::Capistrano3.new(Logger.new(STDOUT)),
29
- # ScoutApm::DeployIntegrations::Capistrano2.new(Logger.new(STDOUT)),
33
+ ScoutApm::DeployIntegrations::Capistrano3.new(STDOUT_LOGGER),
34
+ # ScoutApm::DeployIntegrations::Capistrano2.new(STDOUT_LOGGER),
30
35
  ]
31
36
 
32
37
  def env
@@ -42,6 +42,7 @@ module ScoutApm
42
42
  case config["adapter"].to_s
43
43
  when "postgres" then :postgres
44
44
  when "postgresql" then :postgres
45
+ when "postgis" then :postgres
45
46
  when "sqlite3" then :sqlite
46
47
  when "mysql" then :mysql
47
48
  else default
@@ -38,9 +38,10 @@ module ScoutApm
38
38
  if defined?(ActiveRecord::Base)
39
39
  config = ActiveRecord::Base.connection_config
40
40
  if config && config[:adapter]
41
- case config[:adapter]
41
+ case config[:adapter].to_s
42
42
  when "postgres" then :postgres
43
43
  when "postgresql" then :postgres
44
+ when "postgis" then :postgres
44
45
  when "sqlite3" then :sqlite
45
46
  when "mysql" then :mysql
46
47
  else default
@@ -2,8 +2,8 @@
2
2
  module ScoutApm
3
3
  module Serializers
4
4
  class PayloadSerializer
5
- def self.serialize(metrics, slow_transactions)
6
- Marshal.dump(:metrics => metrics, :slow_transactions => slow_transactions)
5
+ def self.serialize(metadata, metrics, slow_transactions)
6
+ Marshal.dump(:metadata => metadata, :metrics => metrics, :slow_transactions => slow_transactions)
7
7
  end
8
8
 
9
9
  def self.deserialize(data)
@@ -0,0 +1,15 @@
1
+ module ScoutApm
2
+ module Utils
3
+ class UniqueId
4
+ ALPHABET = ('a'..'z').to_a.freeze
5
+
6
+ def self.simple(length=16)
7
+ s = ""
8
+ length.times do
9
+ s << ALPHABET[rand(26)]
10
+ end
11
+ s
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,4 +1,4 @@
1
1
  module ScoutApm
2
- VERSION = "0.9.2.2"
2
+ VERSION = "0.9.3pre1"
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.2.2
4
+ version: 0.9.3pre1
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-10-12 00:00:00.000000000 Z
12
+ date: 2015-10-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
@@ -121,6 +121,7 @@ files:
121
121
  - lib/scout_apm/utils/sql_sanitizer_regex.rb
122
122
  - lib/scout_apm/utils/sql_sanitizer_regex_1_8_7.rb
123
123
  - lib/scout_apm/utils/time.rb
124
+ - lib/scout_apm/utils/unique_id.rb
124
125
  - lib/scout_apm/version.rb
125
126
  - scout_apm.gemspec
126
127
  - test/data/config_test_1.yml
@@ -144,9 +145,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
144
145
  version: '0'
145
146
  required_rubygems_version: !ruby/object:Gem::Requirement
146
147
  requirements:
147
- - - ">="
148
+ - - ">"
148
149
  - !ruby/object:Gem::Version
149
- version: '0'
150
+ version: 1.3.1
150
151
  requirements: []
151
152
  rubyforge_project: scout_apm
152
153
  rubygems_version: 2.2.2