appoptics_apm 4.11.0 → 4.11.1

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: 10400db84a2a1a68fb58d21e3242c39377cc334d18cbd8ed5df1f47f5708787b
4
- data.tar.gz: 0ca5bfa1737e1dc75e63d8b3f97af692a305620554428ac379eada53c802842b
3
+ metadata.gz: 26c9d31f4b5d680bd14d2cc041c337ea687f87e85c909fb6133d92e3f8292105
4
+ data.tar.gz: 1694af39aa2e9c8105a7d1b4fa590af16a5a86ae2b41bc9998531f2b16d192af
5
5
  SHA512:
6
- metadata.gz: c59d11940602ab5e3d36b6b0809c4247ac7217ea335904b4b18bff5cd7b601e650d3f696d4e4146fe919b0f4a5f725a199711d50fd4b25a8ca14478a4d88df00
7
- data.tar.gz: 6dfaea0bfe049cccaefbd174433d22918d0516c9e6ddb7c6b2503cbb11cea86848cf9b8efb26546ebf738df3c6daf8f3e8dbacbf5d691116ecd1e736e91dd5cd
6
+ metadata.gz: 3257648c80a8da542d0e3f99a49c53b4ea6f3c2dd3ef37d6e6ebc1384f53054b3883b41f6ae43880f310a5ff4b49c37eaa67450a2d9818946e248180c6834222
7
+ data.tar.gz: ba4d2a1e71ab6805d73a038bbd1c6593889249e5ebdac1005cbb9df6befad04ef728bcfc67780db2352a10a43c694e991314530452dca57d17297f75c30c3d69
data/.gitignore CHANGED
@@ -32,3 +32,4 @@ scrap*
32
32
  *.code-workspace
33
33
  .irb_history
34
34
  .bundle/
35
+ /builds/
@@ -8,13 +8,12 @@ cache:
8
8
  env:
9
9
  - DBTYPE=postgresql
10
10
  - DBTYPE=mysql2
11
- - DBTYPE=mysql
12
11
 
13
12
  rvm:
13
+ - 2.7.0
14
14
  - 2.6.4
15
15
  - 2.5.5
16
16
  - 2.4.5
17
- - 2.7.0
18
17
  - ruby-head
19
18
  # - jruby-9.0.5.0
20
19
 
@@ -34,42 +33,14 @@ matrix:
34
33
  exclude:
35
34
  - rvm: ruby-head
36
35
  gemfile: gemfiles/rails42.gemfile
37
- - rvm: 2.7.0-preview2
36
+ - rvm: 2.7.0
38
37
  gemfile: gemfiles/rails42.gemfile
39
38
  - rvm: 2.6.4
40
39
  gemfile: gemfiles/rails42.gemfile
41
40
  - rvm: 2.4.5
42
41
  gemfile: gemfiles/rails60.gemfile
43
-
44
- - rvm: ruby-head
45
- env: DBTYPE=mysql
46
- - rvm: 2.7.0-preview2
47
- env: DBTYPE=mysql
48
- - rvm: 2.6.4
49
- env: DBTYPE=mysql
50
- - rvm: 2.5.5
51
- env: DBTYPE=mysql
52
- - rvm: 2.4.5
53
- env: DBTYPE=mysql
54
-
55
- - gemfile: gemfiles/unit.gemfile
56
- env: DBTYPE=mysql
57
- - gemfile: gemfiles/noop.gemfile
58
- env: DBTYPE=mysql
59
- - gemfile: gemfiles/libraries.gemfile
60
- env: DBTYPE=mysql
61
- - gemfile: gemfiles/instrumentation_mocked.gemfile
62
- env: DBTYPE=mysql
63
- - gemfile: gemfiles/instrumentation_mocked_oldgems.gemfile
64
- env: DBTYPE=mysql
65
- - gemfile: gemfiles/frameworks.gemfile
66
- env: DBTYPE=mysql
67
- - gemfile: gemfiles/rails52.gemfile
68
- env: DBTYPE=mysql
69
- - gemfile: gemfiles/rails60.gemfile
70
- env: DBTYPE=mysql
71
- - gemfile: gemfiles/delayed_job.gemfile
72
- env: DBTYPE=mysql
42
+ - rvm: 2.4.5 # excluding because of new sprockets version (4.0.0)
43
+ gemfile: gemfiles/rails52.gemfile
73
44
 
74
45
  - gemfile: gemfiles/unit.gemfile
75
46
  env: DBTYPE=mysql2
@@ -87,9 +58,9 @@ matrix:
87
58
  env: DBTYPE=mysql2
88
59
  allow_failures:
89
60
  - rvm: ruby-head
90
- - rvm: 2.7.0
91
61
 
92
- # FIXME: Figure out if this is still an issue when reviewing cassandra test setup
62
+ # FIXME: No cassandra tests for now
63
+ # ____ Figure out if this is still an issue when reviving cassandra
93
64
  # Attempt Travis/Cassandra fix re: https://github.com/travis-ci/travis-ci/issues/1484
94
65
  # Updated Cassandra: https://github.com/travis-ci/travis-ci/issues/1650
95
66
 
@@ -104,9 +75,17 @@ matrix:
104
75
  # - sudo service cassandra start
105
76
 
106
77
  install:
107
- - curl -LO http://kent.dl.sourceforge.net/project/swig/swig/swig-3.0.12/swig-3.0.12.tar.gz
108
- - tar xzf swig-3.0.12.tar.gz
109
- - pushd swig-3.0.12
78
+ # - curl -LO http://kent.dl.sourceforge.net/project/swig/swig/swig-3.0.12/swig-3.0.12.tar.gz
79
+ # - curl -LO http://kent.dl.sourceforge.net/project/swig/swig/swig-4.0.1/swig-4.0.1.tar.gz
80
+ # - tar xzf swig-4.0.1.tar.gz
81
+ # - pushd swig-4.0.1
82
+ # - ./configure && make && sudo make install
83
+ # - popd
84
+
85
+ # use swig from git, it is the only one that works with Ruby 2.7 for now
86
+ - git clone https://github.com/swig/swig.git
87
+ - pushd swig
88
+ - ./autogen.sh
110
89
  - ./configure && make && sudo make install
111
90
  - popd
112
91
 
@@ -119,8 +98,9 @@ before_script:
119
98
  - export APPOPTICS_TOKEN_BUCKET_RATE=1000
120
99
  - export APPOPTICS_FROM_S3=true
121
100
 
122
- - bundle update --jobs=3 --retry=3
123
- - bundle exec rake clean fetch compile
101
+ # - bundle update --jobs=3 --retry=3
102
+ - ./.travis/bundle.sh
103
+ - bundle exec rake distclean fetch compile
124
104
  - psql -c 'create database travis_ci_test;' -U postgres
125
105
  - mysql -e 'create database travis_ci_test;'
126
106
  - redis-server --requirepass secret_pass &
@@ -0,0 +1,9 @@
1
+ #!/bin/bash
2
+
3
+ if [[ $BUNDLE_GEMFILE == *"gemfiles/frameworks.gemfile"* ]]
4
+ then
5
+ gem install bundler -v 1.17.3
6
+ bundle _1.17.3_ update --jobs=3 --retry=3
7
+ else
8
+ bundle update --jobs=3 --retry=3
9
+ fi
@@ -48,6 +48,8 @@ success = false
48
48
  while retries > 0
49
49
  begin
50
50
  # download
51
+ # TODO warning: calling URI.open via Kernel#open is deprecated, call URI.open directly or use URI#open
52
+ # ____ figure out if URI.open is supported in older rubies
51
53
  download = open(ao_item, 'rb')
52
54
  IO.copy_stream(download, clib)
53
55
 
@@ -1 +1 @@
1
- 7.1.0
1
+ 7.1.1
@@ -13,23 +13,23 @@
13
13
  # ____ what is in the graphql gem and vice-versa
14
14
 
15
15
 
16
- if defined?(GraphQL::Tracing)
16
+ if defined?(GraphQL::Tracing) && !(AppOpticsAPM::Config[:graphql][:enabled] == false)
17
17
  module GraphQL
18
18
  module Tracing
19
19
  # AppOpticsTracing in the graphql gem may be a different version than the
20
20
  # one defined here, we want to use the newer one
21
- dont_redefine = false
21
+ redefine = true
22
22
  this_version = Gem::Version.new('1.0.0')
23
23
 
24
24
  if defined?(GraphQL::Tracing::AppOpticsTracing)
25
25
  if this_version > GraphQL::Tracing::AppOpticsTracing.version
26
26
  send(:remove_const, :AppOpticsTracing)
27
27
  else
28
- dont_redefine = true
28
+ redefine = false
29
29
  end
30
30
  end
31
31
 
32
- unless dont_redefine
32
+ if redefine
33
33
  #-----------------------------------------------------------------------------#
34
34
  #----- this class is duplicated in the graphql gem ---------------------------#
35
35
  #-----------------------------------------------------------------------------#
@@ -84,7 +84,7 @@ if defined?(GraphQL::Tracing)
84
84
 
85
85
  def transaction_name(query)
86
86
  return if gql_config[:transaction_name] == false ||
87
- ::AppOpticsAPM::SDK.get_transaction_name
87
+ ::AppOpticsAPM::SDK.get_transaction_name
88
88
 
89
89
  split_query = query.strip.split(/\W+/, 3)
90
90
  split_query[0] = 'query' if split_query[0].empty?
@@ -95,7 +95,7 @@ if defined?(GraphQL::Tracing)
95
95
 
96
96
  def multiplex_transaction_name(names)
97
97
  return if gql_config[:transaction_name] == false ||
98
- ::AppOpticsAPM::SDK.get_transaction_name
98
+ ::AppOpticsAPM::SDK.get_transaction_name
99
99
 
100
100
  name = "graphql.multiplex.#{names.join('.')}"
101
101
  name = "#{name[0..251]}..." if name.length > 254
@@ -167,8 +167,8 @@ if defined?(GraphQL::Tracing)
167
167
 
168
168
  # remove arguments
169
169
  query.gsub(/"[^"]*"/, '"?"') # strings
170
- .gsub(/-?[0-9]*\.?[0-9]+e?[0-9]*/, '?') # ints + floats
171
- .gsub(/\[[^\]]*\]/, '[?]') # arrays
170
+ .gsub(/-?[0-9]*\.?[0-9]+e?[0-9]*/, '?') # ints + floats
171
+ .gsub(/\[[^\]]*\]/, '[?]') # arrays
172
172
  end
173
173
 
174
174
  def remove_comments(query)
@@ -184,10 +184,16 @@ if defined?(GraphQL::Tracing)
184
184
 
185
185
  module AppOpticsAPM
186
186
  module GraphQLSchemaPrepend
187
- def use(plugin, options = {})
188
- super unless GraphQL::Schema.plugins.find { |pl| pl[0].to_s == plugin.to_s }
187
+ def use(plugin, **options)
188
+ # super unless GraphQL::Schema.plugins.find { |pl| pl[0].to_s == plugin.to_s }
189
+ super unless self.plugins.find { |pl| pl[0].to_s == plugin.to_s }
189
190
 
190
- GraphQL::Schema.plugins
191
+ self.plugins
192
+ end
193
+
194
+ def inherited(subclass)
195
+ subclass.use(GraphQL::Tracing::AppOpticsTracing)
196
+ super
191
197
  end
192
198
  end
193
199
 
@@ -200,16 +206,35 @@ if defined?(GraphQL::Tracing)
200
206
  end
201
207
  end
202
208
  # rubocop:enable Style/RedundantSelf
203
- end
204
209
 
205
- if defined?(GraphQL::Schema)
206
- GraphQL::Schema.singleton_class.prepend(AppOpticsAPM::GraphQLSchemaPrepend)
207
- GraphQL::Schema.use(GraphQL::Tracing::AppOpticsTracing)
210
+ # a different way of autoinstrumenting for graphql 1.7.4 - < 1.8.0
211
+ module GraphQLSchemaPrepend17
212
+ def initialize
213
+ super
214
+ unless tracers.find { |tr| tr.is_a? GraphQL::Tracing::AppOpticsTracing }
215
+ tracer = GraphQL::Tracing::AppOpticsTracing.new
216
+ tracers.push(tracer)
217
+ instrumenters[:field] << tracer
218
+ end
219
+ end
220
+ end
208
221
  end
209
222
 
210
- # rubocop:disable Style/IfUnlessModifier
211
- if defined?(GraphQL::Error)
212
- GraphQL::Error.prepend(AppOpticsAPM::GraphQLErrorPrepend)
223
+ if Gem.loaded_specs['graphql'] && Gem.loaded_specs['graphql'].version >= Gem::Version.new('1.8.0')
224
+ AppOpticsAPM.logger.info '[appoptics_apm/loading] Instrumenting GraphQL' if AppOpticsAPM::Config[:verbose]
225
+ if defined?(GraphQL::Schema)
226
+ GraphQL::Schema.singleton_class.prepend(AppOpticsAPM::GraphQLSchemaPrepend)
227
+ end
228
+
229
+ # rubocop:disable Style/IfUnlessModifier
230
+ if defined?(GraphQL::Error)
231
+ GraphQL::Error.prepend(AppOpticsAPM::GraphQLErrorPrepend)
232
+ end
233
+ # rubocop:enable Style/IfUnlessModifier
234
+ elsif Gem.loaded_specs['graphql'] && Gem.loaded_specs['graphql'].version >= Gem::Version.new('1.7.4')
235
+ AppOpticsAPM.logger.info '[appoptics_apm/loading] Instrumenting GraphQL' if AppOpticsAPM::Config[:verbose]
236
+ if defined?(GraphQL::Schema)
237
+ GraphQL::Schema.prepend(AppOpticsAPM::GraphQLSchemaPrepend17)
238
+ end
213
239
  end
214
- # rubocop:enable Style/IfUnlessModifier
215
240
  end
@@ -156,4 +156,4 @@ if defined?(GRPC) && AppOpticsAPM::Config[:grpc_client][:enabled]
156
156
 
157
157
  end
158
158
  end
159
- end
159
+ end
@@ -64,4 +64,4 @@ module AppOpticsAPM
64
64
 
65
65
  end
66
66
  end
67
- end
67
+ end
@@ -8,7 +8,7 @@ module AppOpticsAPM
8
8
  module Version
9
9
  MAJOR = 4 # breaking,
10
10
  MINOR = 11 # feature,
11
- PATCH = 0 # fix => BFF
11
+ PATCH = 1 # fix => BFF
12
12
 
13
13
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
14
14
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appoptics_apm
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.11.0
4
+ version: 4.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maia Engeli
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-01-14 00:00:00.000000000 Z
13
+ date: 2020-02-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json
@@ -133,7 +133,7 @@ dependencies:
133
133
  description: 'Automatic tracing and metrics for Ruby applications. Get started at
134
134
  appoptics.com. @AppOptics
135
135
 
136
- '
136
+ '
137
137
  email: support@appoptics.com
138
138
  executables:
139
139
  - appoptics_apm_config
@@ -147,6 +147,7 @@ files:
147
147
  - ".gitignore"
148
148
  - ".rubocop.yml"
149
149
  - ".travis.yml"
150
+ - ".travis/bundle.sh"
150
151
  - ".yardopts"
151
152
  - CHANGELOG.md
152
153
  - CONFIG.md