skylight 1.7.1 → 1.7.2

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
  SHA256:
3
- metadata.gz: ad288b69779cb31529b64adbc47d976b06f5300cbb7ff0687b94d412880311dc
4
- data.tar.gz: de757d14b9080b43e2e0d139965fade57bcaabe924e975b4b46ddbe1f7907563
3
+ metadata.gz: 38b118d85b7e46213e2514bbaa79fea48031adab3189a911220efc8a73d8d193
4
+ data.tar.gz: 1c9654be2fe1269c907a39d18621116f62f66f268dd0c137bc6e01ef6aec77e7
5
5
  SHA512:
6
- metadata.gz: 023eff94d6cacf557aeac45a4fee501bf90ac4595d58a671789f3bb6b4726230be6fe3b36805af173809226bbc8c1181d0c073f45d935486da818b824ae47f3f
7
- data.tar.gz: 4e538a415d63cd62208c6b51ed816e0202e20b9ffc926628e631eeedd896d6dc3c95d83bfc24d1894e83664dadee68a0b80d94e49c2207c5c55b286c333b6e61
6
+ metadata.gz: db3dd167fdfe558b82794cfd832f7f35732ad9c63bcf63d6d68645fdce714f4793cb5cfb055668843fd5993806a92bf7233a8093e1b5d4c84580048c253a5cbb
7
+ data.tar.gz: 6445f6c23aa6d6fc3ca14dbfb46606756234294806dcd6b92042a7edfc6e2cff586a778c7053ff22a26698c45bb7723903cb7c8954b6aea2e6bdd50b99a5c164
@@ -1,3 +1,6 @@
1
+ ## 1.7.2 (December 14 2018)
2
+ * [BUGFIX] (Backported from 3.1.x series) Fix issue where routes in mounted engines could cause spans to be closed out-of-order.
3
+
1
4
  ## 1.7.1 (October 16 2018)
2
5
  * [BUGFIX] (Backported from 2.x series) Fix issue wherein certain error-handling patterns could break the middleware probe.
3
6
 
@@ -0,0 +1,30 @@
1
+ module Skylight
2
+ module Probes
3
+ module ActionDispatch
4
+ module Routing
5
+ module RouteSet
6
+ class Probe
7
+
8
+ def install
9
+ ::ActionDispatch::Routing::RouteSet.class_eval do
10
+ alias call_without_sk call
11
+ def call(env)
12
+ trace = Skylight::Instrumenter.try(:instance).try(:current_trace)
13
+ return call_without_sk(env) unless trace
14
+
15
+ trace.endpoint = self.class.name
16
+ Skylight.instrument(title: self.class.name, category: 'rack.app') do
17
+ call_without_sk(env)
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+
24
+ end
25
+ end
26
+ end
27
+
28
+ register(:rails_router, 'ActionDispatch::Routing::RouteSet', 'action_dispatch/routing/route_set', ActionDispatch::Routing::RouteSet::Probe.new)
29
+ end
30
+ end
@@ -38,29 +38,8 @@ module Skylight
38
38
  end
39
39
 
40
40
  class Probe
41
-
42
41
  def install
43
- ActionDispatch::MiddlewareStack.class_eval do
44
- alias build_without_sk build
45
-
46
- if ::ActionPack.respond_to?(:gem_version) && ::ActionPack.gem_version >= Gem::Version.new('5.x')
47
- # Rails 5
48
- def build(app = Proc.new)
49
- Skylight::Probes::Middleware.add_instrumentation(app, "Rack App", "rack.app")
50
- build_without_sk(app)
51
- end
52
- else
53
- # Rails 3 and 4
54
- def build(app, &block)
55
- app ||= block
56
- raise "MiddlewareStack#build requires an app" unless app
57
- Skylight::Probes::Middleware.add_instrumentation(app, "Rack App", "rack.app")
58
- build_without_sk(app)
59
- end
60
- end
61
- end
62
-
63
- ActionDispatch::MiddlewareStack::Middleware.class_eval do
42
+ ::ActionDispatch::MiddlewareStack::Middleware.class_eval do
64
43
  alias build_without_sk build
65
44
  def build(*args)
66
45
  sk_instrument_middleware(build_without_sk(*args))
@@ -16,7 +16,7 @@ module Skylight
16
16
  # net_http, action_controller, action_view, middleware, and grape are on by default
17
17
  # See https://www.skylight.io/support/getting-more-from-skylight#available-instrumentation-options
18
18
  # for a full list.
19
- config.skylight.probes = ['net_http', 'action_controller', 'action_view', 'middleware', 'grape']
19
+ config.skylight.probes = ['net_http', 'action_dispatch', 'action_controller', 'action_view', 'middleware', 'grape']
20
20
 
21
21
  # The position in the middleware stack to place Skylight
22
22
  # Default is first, but can be `{ after: Middleware::Name }` or `{ before: Middleware::Name }`
@@ -1,4 +1,4 @@
1
1
  module Skylight
2
- VERSION = '1.7.1'
2
+ VERSION = '1.7.2'
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: 1.7.1
4
+ version: 1.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tilde, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-16 00:00:00.000000000 Z
11
+ date: 2018-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -108,6 +108,7 @@ files:
108
108
  - lib/skylight/normalizers/moped/query.rb
109
109
  - lib/skylight/probes.rb
110
110
  - lib/skylight/probes/action_controller.rb
111
+ - lib/skylight/probes/action_dispatch.rb
111
112
  - lib/skylight/probes/action_view.rb
112
113
  - lib/skylight/probes/active_model_serializers.rb
113
114
  - lib/skylight/probes/elasticsearch.rb