skylight 6.0.0.beta → 6.0.0.beta2

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
  SHA256:
3
- metadata.gz: ff8e9cf759364d5b113994e6b12046ff5664fbf5d35bcaf54171b82d813c2458
4
- data.tar.gz: cd673dab2a53c62e1103cdc5bba16ccecc7b2fe185247bd9593b774738de2341
3
+ metadata.gz: db7c1b9e7e3c11a49107722bc5493279ecd54ad5b82d01bc9458c15b8f94628d
4
+ data.tar.gz: 8d830a0cb96c6e9437d4433a380677bad41dae15d8e7a01b238c37ac85d31d2f
5
5
  SHA512:
6
- metadata.gz: 841c15efa8d3a99bc248058a01f6c644d5a16302fb964317576bc6fb2e71ad0aa47fc907961821144b5d168ba4dfdfd85d30701a8650532d04fbfdf917e6cf4b
7
- data.tar.gz: 2471c1d1c366136312aac9c3b83a1e669400157da6a3e11437966e151f53d0ae5b449b5f4a1e4b513cd802da07d6ab2a92417cc544e9ab93a798e67f59f7e73a
6
+ metadata.gz: 8644d21c6ade08e05538ef1d237945b44fe87a58ea9301f3150423769c1dde523c8a9e1cae19f3f218df27349db1e5551ca95300ef32bc920473b70ad859d905
7
+ data.tar.gz: 9a27ba15d8ec9a51922628bc4851016f41fa7efd24f998e129fa3e36b09791b03fc23a05fa9ee0fbe8a3a30b0b8abbd9717927fd378d931342c29f6c058a6107
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 6.0.0-beta2 (prerelease)
2
+ - [IMPROVEMENT] Better support for GraphQL versions >= 2.0.18.
3
+
1
4
  ## 6.0.0-beta (prerelease)
2
5
  - [BREAKING] End support for Ruby 2.6
3
6
  - The following libraries are no longer tested and are not guaranteed to work with Skylight 6:
@@ -11,6 +14,8 @@
11
14
  responder (like a Rails router), Skylight will not set the endpoint name after exception processing has started.
12
15
  This means that error traces will now be aggregated under the original endpoint that generated the error (but with
13
16
  the 'error' segment), rather than under the exception handler's controller and action name.
17
+ - [IMPROVEMENT] (Once again) Provide native support for FreeBSD.
18
+ - [BUGFIX] Fix an issue in which the daemon could time out if the processes file descriptor count was set very high (e.g. on Heroku's Performance dynos)
14
19
 
15
20
  ## 5.3.4 (October 17, 2022)
16
21
 
@@ -11,20 +11,67 @@ module Skylight
11
11
 
12
12
  return unless defined?(@tracers)
13
13
 
14
+ # This is the legacy tracing used in graphql =< 2.0.17
14
15
  unless @tracers.include?(::GraphQL::Tracing::ActiveSupportNotificationsTracing)
15
16
  @tracers << ::GraphQL::Tracing::ActiveSupportNotificationsTracing
16
17
  end
17
18
  end
18
19
  end
19
20
 
21
+ module InstrumentationV2
22
+ def self.included(base)
23
+ base.singleton_class.prepend ClassMethods
24
+ end
25
+
26
+ # GraphQL versions 2.0.18 - 2.0.21 (or higher?) were missing this notification
27
+ module ExecuteMultiplexNotification
28
+ def execute_multiplex(**metadata, &blk)
29
+ if @notifications_engine
30
+ @notifications_engine.instrument("execute_multiplex.graphql", metadata, &blk)
31
+ else
32
+ # safety fallback in case graphql's authors unexpectedly rename @notifications_engine
33
+ super
34
+ end
35
+ end
36
+ end
37
+
38
+ module ClassMethods
39
+ def new_trace(*, **)
40
+ unless @__sk_instrumentation_installed
41
+ trace_with(::GraphQL::Tracing::ActiveSupportNotificationsTrace)
42
+
43
+ unless ::GraphQL::Tracing::ActiveSupportNotificationsTrace.instance_methods.include?(:execute_multiplex)
44
+ trace_with(ExecuteMultiplexNotification)
45
+ end
46
+
47
+ @__sk_instrumentation_installed = true
48
+ end
49
+
50
+ super
51
+ end
52
+ end
53
+ end
54
+
20
55
  class Probe
21
56
  def install
22
- tracing_klass_name = "::GraphQL::Tracing::ActiveSupportNotificationsTracing"
23
- klasses_to_probe = %w[::GraphQL::Execution::Multiplex ::GraphQL::Query]
57
+ new_tracing = false
58
+ begin
59
+ require "graphql/tracing/active_support_notifications_trace"
60
+ new_tracing = true
61
+ rescue LoadError # rubocop:disable Lint/SuppressedException
62
+ end
63
+
64
+ if new_tracing
65
+ # GraphQL >= 2.0.18
66
+ ::GraphQL::Schema.include(InstrumentationV2)
67
+ else
68
+ tracing_klass_name = "::GraphQL::Tracing::ActiveSupportNotificationsTracing"
69
+ klasses_to_probe = %w[::GraphQL::Execution::Multiplex ::GraphQL::Query]
24
70
 
25
- return unless ([tracing_klass_name] + klasses_to_probe).all?(&method(:safe_constantize))
71
+ return unless ([tracing_klass_name] + klasses_to_probe).all?(&method(:safe_constantize))
26
72
 
27
- klasses_to_probe.each { |klass_name| safe_constantize(klass_name).prepend(Instrumentation) }
73
+ klasses_to_probe.each { |klass_name| safe_constantize(klass_name).prepend(Instrumentation) }
74
+ end
28
75
  end
29
76
 
30
77
  def safe_constantize(klass_name)
@@ -3,5 +3,5 @@ module Skylight
3
3
  # for compatibility with semver when it is parsed by the rust agent.
4
4
  # This string will be transformed in the gemspec to "5.0.0.alpha"
5
5
  # to conform with rubygems.
6
- VERSION = "6.0.0-beta".freeze
6
+ VERSION = "6.0.0-beta2".freeze
7
7
  end
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: 6.0.0.beta
4
+ version: 6.0.0.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tilde, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-03 00:00:00.000000000 Z
11
+ date: 2023-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport