raygun-apm 1.0.42-x86-linux → 1.0.47-x86-linux

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: da0efde7ad42d2a553ad6e0bec7f0b19385df03028f0f59feae081991ad27748
4
- data.tar.gz: 06b4bb7197fb413b14a73c1d6adbf3912001d4a2be65a4a4f92f2641f420dca2
3
+ metadata.gz: 5267b927db4508a60a5d545db9be42c7593d486df77c20cbf30630c4db758846
4
+ data.tar.gz: 1e85b064c6498c7a1f0af4b88de3fa117320f6e251cd48004fe17df096c0243b
5
5
  SHA512:
6
- metadata.gz: 74a3904d2036bc43aeb2b7fb2000701513e8212fe9ebe1c8136cdbc6f3f08f293af2474317fe078f8c7cf93ff6b828f57f24eb4af667c02a6a577ad686197f19
7
- data.tar.gz: c5d81c12e8cf6cdabbee175494a33fff19f5cd60e27dd340b5c395743d29f190b3d557d363e72fcab7ee3f0f11fee5f40eeb3e3a59e55b6cd81b0d2eb0228694
6
+ metadata.gz: d0d24be1abf691f50a619e69d5ee59d1dc3aeef6df745d2a9cfbae2b79430f35af99e8193fd09bb14a92da509e4f4ef03b1dd33b105788aa831fd276c4c8ff24
7
+ data.tar.gz: 44c7e4e3f87d877583ebb14da55d2a0b56f945b6a381c95505d759121bc8cb500cf9cff9b53b0a9831a8d9fde26a1dacb66f12534a22555e7161ea2b530d1b16
@@ -27,6 +27,7 @@ if ENV['DEBUG']
27
27
  append_cflags '-fstack-protector-all'
28
28
  append_cflags '-DRB_RG_DEBUG'
29
29
  else
30
+ #append_cflags '-DRAX_DEBUG_MSG'
30
31
  append_cflags '-O3'
31
32
  end
32
33
 
Binary file
Binary file
Binary file
@@ -7,6 +7,8 @@ rescue LoadError
7
7
  end
8
8
  require "raygun/apm/config"
9
9
  require "raygun/apm/diagnostics"
10
+ require "raygun/apm/blacklist/parser"
11
+ require "raygun/apm/blacklist/translator"
10
12
  require "raygun/apm/tracer"
11
13
  require "raygun/apm/event"
12
14
  require "raygun/apm/hooks/net_http"
@@ -1,7 +1,8 @@
1
1
  module Raygun
2
2
  module Apm
3
- class Blacklist
3
+ module Blacklist
4
4
  PROFILER = %w{
5
+ Raygun
5
6
  Raygun::Apm::
6
7
  }
7
8
 
@@ -11,224 +12,415 @@ module Raygun
11
12
  #<Module:
12
13
  #<Class:
13
14
  #<#<Class:
14
- ARGF
15
- ArgumentError
16
- Array
17
- Base64
18
- BasicObject
19
- Binding
20
- Class
21
- ClosedQueueError
22
- Comparable
23
- Complex
24
- ConditionVariable
25
- Continuation
26
- Data
27
- Dir
28
- ENV
29
- EOFError
30
- Encoding
31
- Encoding::CompatibilityError
32
- Encoding::Converter
33
- Encoding::ConverterNotFoundError
34
- Encoding::InvalidByteSequenceError
35
- Encoding::UndefinedConversionError
36
- EncodingError
37
- Enumerable
38
- Enumerator
39
- Enumerator::ArithmeticSequence
40
- Enumerator::Chain
41
- Enumerator::Generator
42
- Enumerator::Lazy
43
- Enumerator::Yielder
44
- Errno
45
- Exception
46
- FalseClass
47
- Fiber
48
- FiberError
49
- File
50
- File::Constants
51
- File::Stat
52
- FileTest
53
- Float
54
- FloatDomainError
55
- FrozenError
56
- GC
57
- GC::Profiler
58
- Hash
59
- IO
60
- IO::EAGAINWaitReadable
61
- IO::EAGAINWaitWritable
62
- IO::EINPROGRESSWaitReadable
63
- IO::EINPROGRESSWaitWritable
64
- IO::EWOULDBLOCKWaitReadable
65
- IO::EWOULDBLOCKWaitWritable
66
- IO::WaitReadable
67
- IO::WaitWritable
68
- IOError
69
- IndexError
70
- Integer
71
- Interrupt
72
- JSON
73
- Kernel
74
- KeyError
75
- LoadError
76
- LocalJumpError
77
- Marshal
78
- MatchData
79
- Math
80
- Math::DomainError
81
- Method
82
- Module
83
- Mutex
84
- NameError
85
- NilClass
86
- NoMemoryError
87
- NoMethodError
88
- NotImplementedError
89
- Numeric
90
- Object
91
- ObjectSpace
92
- ObjectSpace::WeakMap
93
- Proc
94
- Process
95
- Process::GID
96
- Process::Status
97
- Process::Sys
98
- Process::UID
99
- Psych
100
- Queue
101
- Random
102
- Random::Formatter
103
- Range
104
- RangeError
105
- Rational
106
- Regexp
107
- RegexpError
108
- RubyVM
109
- RubyVM::AbstractSyntaxTree
110
- RubyVM::AbstractSyntaxTree::Node
111
- RubyVM::InstructionSequence
112
- RubyVM::MJIT
113
- RuntimeError
114
- ScriptError
115
- SecurityError
116
- Set
117
- SimpleDelegator
118
- Signal
119
- SignalException
120
- SizedQueue
121
- Socket
122
- StandardError
123
- StopIteration
124
- String
125
- Struct
126
- Symbol
127
- SyntaxError
128
- SystemCallError
129
- SystemExit
130
- SystemStackError
131
- Thread
132
- Thread::Backtrace
133
- Thread::Backtrace::Location
134
- ThreadError
135
- ThreadGroup
136
- Time
137
- TracePoint
138
- TrueClass
139
- TypeError
140
- UnboundMethod
141
- UncaughtThrowError
142
- UnicodeNormalize
143
- Warning
144
- ZeroDivisionError
145
- IPAddr
15
+ ARGF#
16
+ ArgumentError#
17
+ Array#
18
+ Base64#
19
+ BasicObject#
20
+ Binding#
21
+ Class#
22
+ ClosedQueueError#
23
+ Comparable#
24
+ Complex#
25
+ ConditionVariable#
26
+ Continuation#
27
+ Data#
28
+ Dir#
29
+ ENV#
30
+ EOFError#
31
+ Encoding#
32
+ Encoding::
33
+ EncodingError#
34
+ Enumerable#
35
+ Enumerator#
36
+ Enumerator::
37
+ Errno#
38
+ Exception#
39
+ FalseClass#
40
+ Fiber#
41
+ FiberError#
42
+ File#
43
+ File::
44
+ FileTest#
45
+ Float#
46
+ FloatDomainError#
47
+ FrozenError#
48
+ GC#
49
+ GC::Profiler#
50
+ Hash#
51
+ IO#
52
+ IO::
53
+ IOError#
54
+ IndexError#
55
+ Integer#
56
+ Interrupt#
57
+ JSON#
58
+ Kernel#
59
+ KeyError#
60
+ LoadError#
61
+ LocalJumpError#
62
+ Marshal#
63
+ MatchData#
64
+ Math#
65
+ Math::
66
+ Method#
67
+ Module#
68
+ Mutex#
69
+ NameError#
70
+ NilClass#
71
+ NoMemoryError#
72
+ NoMethodError#
73
+ NotImplementedError#
74
+ Numeric#
75
+ Object#
76
+ ObjectSpace#
77
+ ObjectSpace::
78
+ Proc#
79
+ Process#
80
+ Process::
81
+ Psych#
82
+ Queue#
83
+ Random#
84
+ Random::
85
+ Range#
86
+ RangeError#
87
+ Rational#
88
+ Regexp#
89
+ RegexpError#
90
+ RubyVM#
91
+ RubyVM::
92
+ RuntimeError#
93
+ ScriptError#
94
+ SecurityError#
95
+ Set#
96
+ SimpleDelegator#
97
+ Signal#
98
+ SignalException#
99
+ SizedQueue#
100
+ Socket#
101
+ StandardError#
102
+ StopIteration#
103
+ String#
104
+ Struct#
105
+ Symbol#
106
+ SyntaxError#
107
+ SystemCallError#
108
+ SystemExit#
109
+ SystemStackError#
110
+ Thread#
111
+ Thread::
112
+ ThreadError#
113
+ ThreadGroup#
114
+ Timeout
115
+ Time#
116
+ TracePoint#
117
+ TrueClass#
118
+ TypeError#
119
+ UnboundMethod#
120
+ UncaughtThrowError#
121
+ UnicodeNormalize#
122
+ Warning#
123
+ ZeroDivisionError#
124
+ IPAddr#
146
125
  Net::
147
- OpenSSL
148
- BasicSocket
149
- Forwardable
150
- Gem
151
- FFI
152
- Addrinfo
153
- Open3
154
- Shellwords
155
- WeakRef
156
- RbConfig
157
- Singleton
158
- OpenStruct
159
- Bundler
160
- Delegator
161
- PrettyPrint
162
- PP
126
+ OpenSSL#
127
+ OpenSSL::
128
+ BasicSocket#
129
+ Forwardable#
130
+ Gem#
131
+ FFI#
132
+ Addrinfo#
133
+ Open3#
134
+ Shellwords#
135
+ WeakRef#
136
+ RbConfig#
137
+ Singleton#
138
+ OpenStruct#
139
+ Bundler#
140
+ Delegator#
141
+ PrettyPrint#
142
+ PP#
143
+ Minitest
144
+ Psych
145
+ Mutex_m#
146
+ ERB#
147
+ ERB::
148
+ Gem#
149
+ Gem::
150
+ FileUtils#
151
+ FileUtils::
152
+ TempFile#
153
+ TempFile::
163
154
  }
164
155
 
165
156
  HTTP_OUT = %w{
166
- # Faraday
157
+ #Faraday
167
158
  URI
168
159
  MonitorMixin
169
160
  Faraday
170
- +Faraday::Connection::get
171
- +Faraday::Connection::head
172
- +Faraday::Connection::delete
173
- +Faraday::Connection::trace
174
- +Faraday::Connection::post
175
- +Faraday::Connection::put
176
- +Faraday::Connection::patch
161
+ +Faraday::Connection#get
162
+ +Faraday::Connection#head
163
+ +Faraday::Connection#delete
164
+ +Faraday::Connection#trace
165
+ +Faraday::Connection#post
166
+ +Faraday::Connection#put
167
+ +Faraday::Connection#patch
177
168
  #multipart-post
178
169
  Multipartable
179
170
  SecureRandom
180
171
  Parts
181
172
  CompositeReadIO
182
- +Multipartable::initialize
173
+ +Multipartable#initialize
183
174
  #rest-client
184
175
  RestClient
185
176
  Netrc
186
177
  HTTP::CookieJar
187
178
  DomainName
188
179
  HTTP::Accept
189
- +RestClient::get
190
- +RestClient::head
191
- +RestClient::delete
192
- +RestClient::trace
193
- +RestClient::post
194
- +RestClient::put
195
- +RestClient::patch
180
+ +RestClient.get
181
+ +RestClient.head
182
+ +RestClient.delete
183
+ +RestClient.trace
184
+ +RestClient.post
185
+ +RestClient.put
186
+ +RestClient.patch
196
187
  #excon
197
188
  Excon
198
- +Excon::get
199
- +Excon::head
200
- +Excon::delete
201
- +Excon::trace
202
- +Excon::post
203
- +Excon::put
204
- +Excon::patch
189
+ +Excon.get
190
+ +Excon.head
191
+ +Excon.delete
192
+ +Excon.trace
193
+ +Excon.post
194
+ +Excon.put
195
+ +Excon.patch
205
196
  #HTTParty
206
197
  HTTParty
207
- +HTTParty::get
208
- +HTTParty::head
209
- +HTTParty::delete
210
- +HTTParty::trace
211
- +HTTParty::post
212
- +HTTParty::put
213
- +HTTParty::patch
198
+ +HTTParty.get
199
+ +HTTParty.head
200
+ +HTTParty.delete
201
+ +HTTParty.trace
202
+ +HTTParty.post
203
+ +HTTParty.put
204
+ +HTTParty.patch
214
205
  #httpclient
215
206
  HTTPClient
216
207
  HTTP::Message
217
- +HTTPClient::get
218
- +HTTPClient::head
219
- +HTTPClient::delete
220
- +HTTPClient::trace
221
- +HTTPClient::post
222
- +HTTPClient::put
223
- +HTTPClient::patch
224
- #stdlib net-http
225
- +Net::HTTP::get_response
226
- +Net::HTTP::post
227
- +Net::HTTP::post_form
208
+ +HTTPClient#get
209
+ +HTTPClient#head
210
+ +HTTPClient#delete
211
+ +HTTPClient#trace
212
+ +HTTPClient#post
213
+ +HTTPClient#put
214
+ +HTTPClient#patch
215
+ #net-http
216
+ +Net::HTTP.get_response
217
+ +Net::HTTP.get
218
+ +Net::HTTP.head
219
+ +Net::HTTP.delete
220
+ +Net::HTTP.trace
221
+ +Net::HTTP.post
222
+ +Net::HTTP.put
223
+ +Net::HTTP.patch
224
+ +Net::HTTP.post_form
228
225
  }
229
226
 
230
227
  QUERIES = %w{
231
- +Raygun::Apm::Hooks::Redis::process
228
+ #redis
229
+ Redis
230
+ +Redis#auth
231
+ +Redis#select
232
+ +Redis#ping
233
+ +Redis#echo
234
+ +Redis#bgrewriteaof
235
+ +Redis#bgsave
236
+ +Redis#config
237
+ +Redis#dbsize
238
+ +Redis#debug
239
+ +Redis#flushall
240
+ +Redis#flushdb
241
+ +Redis#info
242
+ +Redis#lastsave
243
+ +Redis#monitor
244
+ +Redis#save
245
+ +Redis#shutdown
246
+ +Redis#slave
247
+ +Redis#slowlog
248
+ +Redis#sync
249
+ +Redis#time
250
+ +Redis#persist
251
+ +Redis#expire
252
+ +Redis#expireat
253
+ +Redis#ttl
254
+ +Redis#pexpire
255
+ +Redis#pexpireat
256
+ +Redis#pttl
257
+ +Redis#dump
258
+ +Redis#restore
259
+ +Redis#migrate
260
+ +Redis#del
261
+ +Redis#unlink
262
+ +Redis#exists
263
+ +Redis#keys
264
+ +Redis#move
265
+ +Redis#object
266
+ +Redis#randomkey
267
+ +Redis#rename
268
+ +Redis#renamenx
269
+ +Redis#sort
270
+ +Redis#type
271
+ +Redis#decr
272
+ +Redis#decrby
273
+ +Redis#incr
274
+ +Redis#incrby
275
+ +Redis#incrbyfloat
276
+ +Redis#set
277
+ +Redis#multi
278
+ +Redis#client
279
+ +Redis#set
280
+ +Redis#setex
281
+ +Redis#psetex
282
+ +Redis#setnx
283
+ +Redis#mset
284
+ +Redis#mapped_mset
285
+ +Redis#msetnx
286
+ +Redis#mapped_msetnx
287
+ +Redis#get
288
+ +Redis#mget
289
+ +Redis#mapped_mget
290
+ +Redis#setrange
291
+ +Redis#getrange
292
+ +Redis#setbit
293
+ +Redis#getbit
294
+ +Redis#append
295
+ +Redis#bitcount
296
+ +Redis#bitop
297
+ +Redis#bitpos
298
+ +Redis#getset
299
+ +Redis#strlen
300
+ +Redis#llen
301
+ +Redis#lpush
302
+ +Redis#lpushx
303
+ +Redis#rpush
304
+ +Redis#rpushx
305
+ +Redis#lpop
306
+ +Redis#rpop
307
+ +Redis#rpoplpush
308
+ +Redis#blpop
309
+ +Redis#brpop
310
+ +Redis#brpoplpush
311
+ +Redis#lindex
312
+ +Redis#linsert
313
+ +Redis#lrange
314
+ +Redis#lrem
315
+ +Redis#lset
316
+ +Redis#ltrim
317
+ +Redis#scard
318
+ +Redis#sadd
319
+ +Redis#srem
320
+ +Redis#spop
321
+ +Redis#srandmember
322
+ +Redis#smove
323
+ +Redis#sismember
324
+ +Redis#smembers
325
+ +Redis#sdiff
326
+ +Redis#sdiffstore
327
+ +Redis#sinter
328
+ +Redis#sinterstore
329
+ +Redis#sunion
330
+ +Redis#sunionstore
331
+ +Redis#zcard
332
+ +Redis#zadd
333
+ +Redis#zincrby
334
+ +Redis#zrem
335
+ +Redis#zpopmax
336
+ +Redis#zpopmin
337
+ +Redis#bzpopmax
338
+ +Redis#bzpopmin
339
+ +Redis#zscore
340
+ +Redis#zrange
341
+ +Redis#zrevrange
342
+ +Redis#zrank
343
+ +Redis#zrevrank
344
+ +Redis#zremrangebyrank
345
+ +Redis#zlexcount
346
+ +Redis#zrangebylex
347
+ +Redis#zrevrangebylex
348
+ +Redis#zrangebyscore
349
+ +Redis#zrevrangebyscore
350
+ +Redis#zremrangebyscore
351
+ +Redis#zcount
352
+ +Redis#zinterstore
353
+ +Redis#zunionstore
354
+ +Redis#hlen
355
+ +Redis#hset
356
+ +Redis#hsetnx
357
+ +Redis#hmset
358
+ +Redis#mapped_hmset
359
+ +Redis#hget
360
+ +Redis#hmget
361
+ +Redis#mapped_hmget
362
+ +Redis#hdel
363
+ +Redis#hexists
364
+ +Redis#hincrby
365
+ +Redis#hincrbyfloat
366
+ +Redis#hkeys
367
+ +Redis#hvals
368
+ +Redis#hgetall
369
+ +Redis#publish
370
+ +Redis#subscribe
371
+ +Redis#subscribe_with_timeout
372
+ +Redis#unsubscribe
373
+ +Redis#psubscribe
374
+ +Redis#psubscribe_with_timeout
375
+ +Redis#punsubscribe
376
+ +Redis#pubsub
377
+ +Redis#watch
378
+ +Redis#unwatch
379
+ +Redis#pipelined
380
+ +Redis#multi
381
+ +Redis#exec
382
+ +Redis#discard
383
+ +Redis#script
384
+ +Redis#eval
385
+ +Redis#evalsha
386
+ +Redis#scan
387
+ +Redis#hscan
388
+ +Redis#zscan
389
+ +Redis#sscan
390
+ +Redis#pfadd
391
+ +Redis#pfcount
392
+ +Redis#pfmerge
393
+ +Redis#geoadd
394
+ +Redis#geohash
395
+ +Redis#georadiusbymember
396
+ +Redis#geopos
397
+ +Redis#geodist
398
+ +Redis#xinfo
399
+ +Redis#xadd
400
+ +Redis#xtrim
401
+ +Redis#xdel
402
+ +Redis#xrange
403
+ +Redis#xrevrange
404
+ +Redis#xlen
405
+ +Redis#xread
406
+ +Redis#xgroup
407
+ +Redis#xreadgroup
408
+ +Redis#xack
409
+ +Redis#xclaim
410
+ +Redis#xpending
411
+ +Redis#sentinel
412
+ +Redis#cluster
413
+ +Redis#asking
414
+ }
415
+
416
+ RAYGUN4RUBY = %w{
417
+ Raygun::Breadcrumbs
418
+ Raygun::Configuration
419
+ Raygun.config
420
+ Raygun.log
421
+ Raygun.should_report?
422
+ Raygun::Client
423
+ +Raygun.track_exception
232
424
  }
233
425
 
234
426
  def self.extend_with(list)
@@ -240,7 +432,7 @@ module Raygun
240
432
  end
241
433
 
242
434
  def self.resolve_entries
243
- DEFAULT_RUBY + PROFILER + HTTP_OUT + QUERIES + self.extended_blacklist.flatten
435
+ DEFAULT_RUBY + PROFILER + HTTP_OUT + QUERIES + RAYGUN4RUBY + self.extended_blacklist.flatten
244
436
  end
245
437
  end
246
438
  end
@@ -0,0 +1,47 @@
1
+ module Raygun
2
+ module Apm
3
+ module Blacklist
4
+ class Parser
5
+ COMMENT = /^#[^<].*/
6
+ ANONYMOUS = /^#<.*:.*>?/
7
+
8
+ def initialize(tracer)
9
+ @tracer = tracer
10
+ @translator = Blacklist::Translator.new
11
+ end
12
+
13
+ def add_filters(filters)
14
+ filters.each do |filter|
15
+ filter.strip!
16
+ add_filter(filter)
17
+ end
18
+ show_filters
19
+ end
20
+
21
+ private
22
+ def add_filter(filter)
23
+ if filter =~ COMMENT && filter !~ ANONYMOUS
24
+ return
25
+ end
26
+ if filter.start_with?('+')
27
+ @tracer.add_whitelist *translate(filter[1..-1])
28
+ elsif filter.start_with?('-')
29
+ @tracer.add_blacklist *translate(filter[1..-1])
30
+ elsif filter.size > 0
31
+ @tracer.add_blacklist *translate(filter)
32
+ end
33
+ rescue => e
34
+ puts "Failed to add line '#{filter}' to the blacklist (#{e}) #{e.backtrace.join("\n")}"
35
+ end
36
+
37
+ def show_filters
38
+ @tracer.show_filters if @tracer.config.loglevel == Tracer::LOG_BLACKLIST
39
+ end
40
+
41
+ def translate(filter)
42
+ @translator.translate(filter)
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,73 @@
1
+ module Raygun
2
+ module Apm
3
+ module Blacklist
4
+ class Translator
5
+ class RubyTranslator
6
+ # Foo::Bar#baz
7
+ # Foo::Bar.baz
8
+ COMMENT = /^#.*/
9
+ ANONYMOUS = /^#<.*>?/
10
+ NAMESPACE = /::/
11
+ NAMESPACE_ONLY = /::$/
12
+ METHOD = /#|\./
13
+ LETTER_CASE = /^[A-Z]/
14
+
15
+ def translate(filter)
16
+ path, method = nil, nil
17
+ if filter !~ COMMENT && filter !~ ANONYMOUS
18
+ if filter.end_with?("#")
19
+ path = filter
20
+ else
21
+ path, method = filter.split(METHOD)
22
+ end
23
+ # .NET fallback
24
+ return if method =~ LETTER_CASE && !method.start_with?("Ruby")
25
+ if path == path.downcase
26
+ method = path
27
+ path = nil
28
+ end
29
+
30
+ # .NET fallback
31
+ return if method =~ NAMESPACE
32
+ [path, method]
33
+ elsif filter =~ ANONYMOUS
34
+ _, klass, method = filter.split(METHOD)
35
+ ["##{klass}", method]
36
+ else
37
+ nil
38
+ end
39
+ end
40
+ end
41
+
42
+ # References https://raygun.com/documentation/product-guides/apm/blacklist/
43
+ class DotnetTranslator
44
+ # Foo.Bar::Baz
45
+ COMMENT = /^#/
46
+ NAMESPACE = /\./
47
+ METHOD = /::/
48
+
49
+ def translate(filter)
50
+ if filter !~ COMMENT
51
+ path, method = nil, nil
52
+ path, method = filter.split(METHOD)
53
+ path.gsub!(NAMESPACE, "::")
54
+ [path, method]
55
+ else
56
+ nil
57
+ end
58
+ end
59
+ end
60
+
61
+ def initialize
62
+ @ruby = RubyTranslator.new
63
+ @dotnet = DotnetTranslator.new
64
+ end
65
+
66
+ def translate(filter)
67
+ translated = @ruby.translate(filter)
68
+ translated ? translated : @dotnet.translate(filter)
69
+ end
70
+ end
71
+ end
72
+ end
73
+ end
@@ -18,43 +18,15 @@ module Raygun
18
18
  attr_accessor :config
19
19
 
20
20
  def initialize(env=ENV)
21
- @config = Config.new(env)
22
- @blacklist = if @config.proton_user_overrides_file && File.exists?(@config.proton_user_overrides_file)
23
- File.readlines(@config.proton_user_overrides_file)
24
- else
25
- []
26
- end
27
- add_filters @blacklist
28
- # Ignore comments set to false here to account for #<Class: etc. in Rails blacklist
29
- add_filters Raygun::Apm::Blacklist.resolve_entries, ignore_comments: false
30
- show_filters if config.loglevel == Tracer::LOG_BLACKLIST
31
- # Special assignments from config to the Tracer
32
- self.log_level = config.loglevel
33
- self.environment = config.environment
34
- self.api_key = config.proton_api_key
35
- self.register_libraries Bundler.load.specs.map(&:full_gem_path).sort << RbConfig::CONFIG['rubylibdir']
36
- agent_connectivity_diagnostics
21
+ configure(env)
22
+ initialize_blacklist
23
+ register_known_library_paths
24
+ run_agent_connectivity_diagnostics
37
25
  ObjectSpace.define_finalizer(self, proc{ disable_tracepoints })
38
26
  # Any fails here is kamikaze for the tracer
39
27
  rescue => e
40
28
  # XXX works for the middleware wrapped case, not for standalone - revisit
41
- raise Raygun::Apm::FatalError, "Raygun APM tracer could not be initialized: #{e.message}"
42
- end
43
-
44
- def add_filters(filters, ignore_comments: true)
45
- filters.each do |filter|
46
- filter.strip!
47
- # comment
48
- if filter.start_with?('#')
49
- add_blacklist filter unless ignore_comments
50
- elsif filter.start_with?('+')
51
- add_whitelist filter[1..-1]
52
- elsif filter.start_with?('-')
53
- add_blacklist filter[1..-1]
54
- elsif filter.size > 0
55
- add_blacklist filter
56
- end
57
- end
29
+ raise Raygun::Apm::FatalError, "Raygun APM tracer could not be initialized: #{e.message} #{e.backtrace.join("\n")}"
58
30
  end
59
31
 
60
32
  def udp_sink!
@@ -71,10 +43,36 @@ module Raygun
71
43
  # Any fails here is kamikaze for the tracer
72
44
  rescue => e
73
45
  # XXX works for the middleware wrapped case, not for standalone - revisit
74
- raise Raygun::Apm::FatalError, "Raygun APM UDP sink could not be initialized: #{e.message}"
46
+ raise Raygun::Apm::FatalError, "Raygun APM UDP sink could not be initialized: #{e.message} #{e.backtrace.join("\n")}"
47
+ end
48
+
49
+ private
50
+ def configure(env)
51
+ @config = Config.new(env)
52
+ # Special assignments from config to the Tracer
53
+ self.log_level = config.loglevel
54
+ self.environment = config.environment
55
+ self.api_key = config.proton_api_key
56
+ end
57
+
58
+ def initialize_blacklist
59
+ @blacklist_parser = Raygun::Apm::Blacklist::Parser.new(self)
60
+ @blacklist = if @config.proton_user_overrides_file && File.exists?(@config.proton_user_overrides_file)
61
+ File.readlines(@config.proton_user_overrides_file)
62
+ else
63
+ []
64
+ end
65
+ # From file
66
+ @blacklist_parser.add_filters @blacklist
67
+ # Defaults
68
+ @blacklist_parser.add_filters Raygun::Apm::Blacklist.resolve_entries
69
+ end
70
+
71
+ def register_known_library_paths
72
+ self.register_libraries Bundler.load.specs.map(&:full_gem_path).sort << RbConfig::CONFIG['rubylibdir']
75
73
  end
76
74
 
77
- def agent_connectivity_diagnostics
75
+ def run_agent_connectivity_diagnostics
78
76
  check = Raygun::Apm::Diagnostics.new
79
77
  check.verify_agent
80
78
  end
@@ -1,5 +1,5 @@
1
1
  module Raygun
2
2
  module Apm
3
- VERSION = "1.0.42"
3
+ VERSION = "1.0.47"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raygun-apm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.42
4
+ version: 1.0.47
5
5
  platform: x86-linux
6
6
  authors:
7
7
  - Raygun
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-06-04 00:00:00.000000000 Z
12
+ date: 2020-06-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: debase-ruby_core_source
@@ -211,6 +211,8 @@ files:
211
211
  - lib/raygun/2.7/raygun_ext.so
212
212
  - lib/raygun/apm.rb
213
213
  - lib/raygun/apm/blacklist.rb
214
+ - lib/raygun/apm/blacklist/parser.rb
215
+ - lib/raygun/apm/blacklist/translator.rb
214
216
  - lib/raygun/apm/config.rb
215
217
  - lib/raygun/apm/diagnostics.rb
216
218
  - lib/raygun/apm/event.rb