skylight 0.10.3 → 0.10.4

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: e5021a4b7363610a4fa2e75f06fb604f8bbd6291
4
- data.tar.gz: fdf81108e04bec3720d605ad0f01a5dd829596d7
3
+ metadata.gz: a76099fda886af0e74d06bed09f512715705be0a
4
+ data.tar.gz: 7f926a22b2da10ecc498995ada0ddc5b48d2b510
5
5
  SHA512:
6
- metadata.gz: 20c12468eb05d79d92d79000eb6135f1dd639ee959a5c136a0dfa90e46d856abab725e31a55c264b3bc9220a3fab794283e01cd137dc50a98c096f7bbe2ad317
7
- data.tar.gz: 170ebfb0801b1a976562bc77facbf435b8a4d56f5a9dcae2fb3020cf26cdc222f08d16c8c7dedb8d8056ddbbb77b033c074e8104f97286923bb2e4744e55084c
6
+ metadata.gz: c054668e4feec17241dbbcfbc6ddb1bf8808d7d718f10a1449940c056ecfdb3d26a2ddfe805e0d0c81d880eb949b699f517687e3cf13eda242bba4e287a5a1c0
7
+ data.tar.gz: 35516e9b5e0cec82a57d1e04e759787a301123b223c9a00d0ae829d2e116f1a1d85154bd79ed962e2229e92757ed36919d25efe55bea5ac608fc640ea51e6771
@@ -1,3 +1,16 @@
1
+ ## 0.10.4 (June 3, 2016)
2
+
3
+ * [BUGFIX] Sinatra instrumenation now works for latest master
4
+ * [BUGFIX] Sequel support for 4.35.0
5
+ * [BUGFIX] Handle latest ActiveModel::Serializers version
6
+ * [BUGFIX] More precise check for existence of Rails
7
+ * [BREAKING] Drop official support for Sinatra 1.2 (it likely never worked correctly)
8
+ * [IMPROVEMENT] On Heroku, logs are now written to STDOUT
9
+ * [IMPROVEMENT] Allow Skylight to raise on logged errors, useful for testing and debugging
10
+ * [IMPROVEMENT] Finish Rack::Responses in Middleware
11
+ * [IMRPOVEMENT] Better message when config/skylight.yml already exists
12
+ * [IMPROVEMENT] Update Rust Agent with SQL improvements
13
+
1
14
  ## 0.10.3 (February 2, 2016)
2
15
 
3
16
  * [BUGFIX] Don't validate configuration on disabled environments.
@@ -22,7 +35,7 @@
22
35
 
23
36
  ## 0.9.4 (November 23, 2015)
24
37
 
25
- * [FEATURE] Added instrumentation for official Mongo Ruby Driver (utilized by Mongoid 5+). Add 'mongo' to probes list to enable.
38
+ * [FEATURE] Added instrumentation for official Mongo Ruby Driver (utilized by Mongoid 5+). Add 'mongo' to probes list to enable.
26
39
  * [BUGFIX] SQL lexer now handles indentifiers beginning with underscores.
27
40
  * [BUGFIX] Excon instrumentation now works correctly.
28
41
  * [BUGFIX] Graceful handling of native agent failures on old OS X versions.
data/LICENSE.md CHANGED
@@ -1,5 +1,5 @@
1
1
  All other components of this product, except where otherwise noted, are
2
- Copyright (c) 2013-2014 Tilde, Inc.
2
+ Copyright (c) 2013-2016 Tilde, Inc.
3
3
  All rights reserved.
4
4
 
5
5
  Certain inventions disclosed in this file may be claimed within patents
@@ -1,6 +1,6 @@
1
1
  ---
2
- version: "0.7.0-b2a5f4b"
2
+ version: "1.0.0-4a74d28"
3
3
  checksums:
4
- x86-linux: "4ea1f0382dbbba12454d5121a4b400278b2b515b79b676e7d4a2655cdc088bfe"
5
- x86_64-linux: "42a958e6fe7f5d9b459e10ffc62c336c44f00e46c253b7f466a72f2902e8e130"
6
- x86_64-darwin: "7958533c605d98f43fbe54cdd7f7a6e39d6c8fee30acd29494465213afd123ef"
4
+ x86-linux: "66e1b9fd8c9223febf8e7febb56a2ad71714ab61193d153e2bf0f462409cb4f7"
5
+ x86_64-linux: "40d7e0822610244d916df5488a83af5bdc7b2aa8b2410abc672a42cfab629f3f"
6
+ x86_64-darwin: "1484612b150317f1debdcaeab9bea806749d8be9ac132b8cd1b92781d1972b46"
@@ -13,7 +13,12 @@ module Skylight
13
13
  desc "setup TOKEN", "Sets up a new app using the provided token"
14
14
  def setup(token=nil)
15
15
  if File.exist?(config_path)
16
- say "Your app is already on Skylight. http://www.skylight.io", :green
16
+ say <<-OUT, :green
17
+ A config/skylight.yml already exists for your application.
18
+
19
+ Visit your app at https://www.skylight.io/app or remove config/skylight.yml
20
+ to set it up as a new app in Skylight.
21
+ OUT
17
22
  return
18
23
  end
19
24
 
@@ -39,7 +44,7 @@ The next step is for you to deploy your application to production. The
39
44
  easiest way is to just commit the config file to your source control
40
45
  repository and deploy from there. You can learn more about the process at:
41
46
 
42
- http://docs.skylight.io/getting-started/#deploy
47
+ http://docs.skylight.io/getting-set-up/#deployment
43
48
 
44
49
  If you want to specify the authentication token as an environment variable,
45
50
  you should set the `SKYLIGHT_AUTHENTICATION` variable to:
@@ -504,6 +504,10 @@ authentication: #{self[:authentication]}
504
504
  @alert_logger = logger
505
505
  end
506
506
 
507
+ def on_heroku?
508
+ File.exist?(get(:'heroku.dyno_info_path'))
509
+ end
510
+
507
511
  def deploy_id
508
512
  @deploy_id = Util::Deploy.detect_id(self)
509
513
  end
@@ -7,7 +7,9 @@ module Skylight
7
7
  # Load the native agent
8
8
  require 'skylight/native'
9
9
 
10
- if defined?(Rails)
10
+ # Specifically check for Railtie since we've had at least one case of a
11
+ # customer having Rails defined without having all of Rails loaded.
12
+ if defined?(Rails::Railtie)
11
13
  require 'skylight/railtie'
12
14
  end
13
15
 
@@ -59,6 +59,13 @@ module Skylight
59
59
  t { "middleware beginning trace" }
60
60
  trace = Skylight.trace "Rack", 'app.rack.request'
61
61
  resp = @app.call(env)
62
+
63
+ # Responses should be finished but in some situations they aren't
64
+ # e.g. https://github.com/ruby-grape/grape/issues/1041
65
+ if resp.respond_to?(:finish)
66
+ resp = resp.finish
67
+ end
68
+
62
69
  resp[2] = BodyProxy.new(resp[2]) { trace.submit } if trace
63
70
  resp
64
71
  rescue Exception
@@ -12,7 +12,9 @@ module Skylight
12
12
  title = serializer_class.name.sub(/^ActiveModel::(Serializer::)?/, '')
13
13
 
14
14
  if adapter_instance = payload[:adapter]
15
- adapter_name = adapter_instance.class.name.sub(/^ActiveModel::Serializer::Adapter::/, '')
15
+ adapter_name = adapter_instance.class.name
16
+ .sub(/^ActiveModel::Serializer::Adapter::/, '')
17
+ .sub(/^ActiveModelSerializers::Adapter::/, '')
16
18
  desc = "Adapter: #{adapter_name}"
17
19
  end
18
20
 
@@ -5,11 +5,14 @@ module Skylight
5
5
  class Probe
6
6
  def install
7
7
  require 'sequel/database/logging'
8
- ::Sequel::Database.class_eval do
9
- alias log_yield_without_sk log_yield
10
8
 
11
- def log_yield(sql, args=nil, &block)
12
- log_yield_without_sk(sql, *args) do
9
+ method_name = ::Sequel::Database.method_defined?(:log_connection_yield) ? 'log_connection_yield' : 'log_yield'
10
+
11
+ ::Sequel::Database.class_eval <<-end_eval
12
+ alias #{method_name}_without_sk #{method_name}
13
+
14
+ def #{method_name}(sql, *args, &block)
15
+ #{method_name}_without_sk(sql, *args) do
13
16
  ::ActiveSupport::Notifications.instrument(
14
17
  "sql.sequel",
15
18
  sql: sql,
@@ -20,7 +23,7 @@ module Skylight
20
23
  end
21
24
  end
22
25
  end
23
- end
26
+ end_eval
24
27
  end
25
28
  end
26
29
  end
@@ -8,7 +8,9 @@ module Skylight
8
8
  alias compile_without_sk! compile!
9
9
 
10
10
  def compile!(verb, path, *args, &block)
11
- compile_without_sk!(verb, path, *args, &block).tap do |_, _, _, wrapper|
11
+ compile_without_sk!(verb, path, *args, &block).tap do |_, _, keys_or_wrapper, wrapper|
12
+ wrapper ||= keys_or_wrapper
13
+
12
14
  # Deal with the situation where the path is a regex, and the default behavior
13
15
  # of Ruby stringification produces an unreadable mess
14
16
  if path.is_a?(Regexp)
@@ -88,7 +88,7 @@ module Skylight
88
88
  # Configure the log file destination
89
89
  if log_file = app.config.skylight.log_file
90
90
  config['log_file'] = log_file
91
- elsif !config.key?('log_file')
91
+ elsif !config.key?('log_file') && !config.on_heroku?
92
92
  config['log_file'] = File.join(Rails.root, 'log/skylight.log')
93
93
  end
94
94
 
@@ -14,7 +14,7 @@ module Skylight
14
14
  end
15
15
 
16
16
  def file_path
17
- File.expand_path("~/.skylight")
17
+ File.expand_path(ENV["SKYLIGHT_USER_CONFIG_PATH"] || "~/.skylight")
18
18
  end
19
19
 
20
20
  def disable_dev_warning?
@@ -57,6 +57,7 @@ module Skylight
57
57
  end
58
58
 
59
59
  def error(msg, *args)
60
+ raise msg if ENV['SKYLIGHT_RAISE_ON_ERROR']
60
61
  log :error, msg, *args
61
62
  end
62
63
 
@@ -1,4 +1,4 @@
1
1
  module Skylight
2
- VERSION = '0.10.3'
2
+ VERSION = '0.10.4'
3
3
  end
4
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skylight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.3
4
+ version: 0.10.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tilde, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-03 00:00:00.000000000 Z
11
+ date: 2016-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -185,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
185
  version: '0'
186
186
  requirements: []
187
187
  rubyforge_project:
188
- rubygems_version: 2.4.5.1
188
+ rubygems_version: 2.5.2
189
189
  signing_key:
190
190
  specification_version: 4
191
191
  summary: Skylight is a smart profiler for Rails apps