raygun-apm 1.0.43-x86-linux → 1.0.44-x86-linux
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/raygun/extconf.rb +1 -0
- data/lib/raygun/2.5/raygun_ext.so +0 -0
- data/lib/raygun/2.6/raygun_ext.so +0 -0
- data/lib/raygun/2.7/raygun_ext.so +0 -0
- data/lib/raygun/apm.rb +2 -0
- data/lib/raygun/apm/blacklist.rb +238 -233
- data/lib/raygun/apm/blacklist/parser.rb +47 -0
- data/lib/raygun/apm/blacklist/translator.rb +73 -0
- data/lib/raygun/apm/tracer.rb +33 -35
- data/lib/raygun/apm/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4087d7298a5a7cb5be64cdaea4a3d534b791f722b30ed63b7d7f0e6355dc86f
|
4
|
+
data.tar.gz: 4a6e7fd007b5b34cd1667a9f2cec3e269333b088de297c5177587b39630d9738
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5f673f12d1e89081a870817e41b70fb95aad73438eb5e63139c22f45df31f2230f61e9da9588f30169994b1b7e8b2a430148eabbe5eab74855a7ee0f2917675
|
7
|
+
data.tar.gz: 60412a023dfcd9a535db3841924a414ae0e37b80d3c5cdb5152d8ef4f6b2515db784caaab28abd07f9c35ab599537747fb1dd1f6e2cbdffe3aa60ff31577a0e1
|
data/ext/raygun/extconf.rb
CHANGED
Binary file
|
Binary file
|
Binary file
|
data/lib/raygun/apm.rb
CHANGED
@@ -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"
|
data/lib/raygun/apm/blacklist.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Raygun
|
2
2
|
module Apm
|
3
|
-
|
3
|
+
module Blacklist
|
4
4
|
PROFILER = %w{
|
5
5
|
Raygun::Apm::
|
6
6
|
}
|
@@ -78,7 +78,7 @@ module Raygun
|
|
78
78
|
MatchData
|
79
79
|
Math
|
80
80
|
Math::DomainError
|
81
|
-
Method
|
81
|
+
Method#
|
82
82
|
Module
|
83
83
|
Mutex
|
84
84
|
NameError
|
@@ -160,273 +160,278 @@ module Raygun
|
|
160
160
|
Delegator
|
161
161
|
PrettyPrint
|
162
162
|
PP
|
163
|
+
Minitest
|
163
164
|
}
|
164
165
|
|
165
166
|
HTTP_OUT = %w{
|
166
|
-
#
|
167
|
+
#Faraday
|
167
168
|
URI
|
168
169
|
MonitorMixin
|
169
170
|
Faraday
|
170
|
-
+Faraday::Connection
|
171
|
-
+Faraday::Connection
|
172
|
-
+Faraday::Connection
|
173
|
-
+Faraday::Connection
|
174
|
-
+Faraday::Connection
|
175
|
-
+Faraday::Connection
|
176
|
-
+Faraday::Connection
|
171
|
+
+Faraday::Connection#get
|
172
|
+
+Faraday::Connection#head
|
173
|
+
+Faraday::Connection#delete
|
174
|
+
+Faraday::Connection#trace
|
175
|
+
+Faraday::Connection#post
|
176
|
+
+Faraday::Connection#put
|
177
|
+
+Faraday::Connection#patch
|
177
178
|
#multipart-post
|
178
179
|
Multipartable
|
179
180
|
SecureRandom
|
180
181
|
Parts
|
181
182
|
CompositeReadIO
|
182
|
-
+Multipartable
|
183
|
+
+Multipartable#initialize
|
183
184
|
#rest-client
|
184
185
|
RestClient
|
185
186
|
Netrc
|
186
187
|
HTTP::CookieJar
|
187
188
|
DomainName
|
188
189
|
HTTP::Accept
|
189
|
-
+RestClient
|
190
|
-
+RestClient
|
191
|
-
+RestClient
|
192
|
-
+RestClient
|
193
|
-
+RestClient
|
194
|
-
+RestClient
|
195
|
-
+RestClient
|
190
|
+
+RestClient.get
|
191
|
+
+RestClient.head
|
192
|
+
+RestClient.delete
|
193
|
+
+RestClient.trace
|
194
|
+
+RestClient.post
|
195
|
+
+RestClient.put
|
196
|
+
+RestClient.patch
|
196
197
|
#excon
|
197
198
|
Excon
|
198
|
-
+Excon
|
199
|
-
+Excon
|
200
|
-
+Excon
|
201
|
-
+Excon
|
202
|
-
+Excon
|
203
|
-
+Excon
|
204
|
-
+Excon
|
199
|
+
+Excon.get
|
200
|
+
+Excon.head
|
201
|
+
+Excon.delete
|
202
|
+
+Excon.trace
|
203
|
+
+Excon.post
|
204
|
+
+Excon.put
|
205
|
+
+Excon.patch
|
205
206
|
#HTTParty
|
206
207
|
HTTParty
|
207
|
-
+HTTParty
|
208
|
-
+HTTParty
|
209
|
-
+HTTParty
|
210
|
-
+HTTParty
|
211
|
-
+HTTParty
|
212
|
-
+HTTParty
|
213
|
-
+HTTParty
|
208
|
+
+HTTParty.get
|
209
|
+
+HTTParty.head
|
210
|
+
+HTTParty.delete
|
211
|
+
+HTTParty.trace
|
212
|
+
+HTTParty.post
|
213
|
+
+HTTParty.put
|
214
|
+
+HTTParty.patch
|
214
215
|
#httpclient
|
215
216
|
HTTPClient
|
216
217
|
HTTP::Message
|
217
|
-
+HTTPClient
|
218
|
-
+HTTPClient
|
219
|
-
+HTTPClient
|
220
|
-
+HTTPClient
|
221
|
-
+HTTPClient
|
222
|
-
+HTTPClient
|
223
|
-
+HTTPClient
|
224
|
-
#
|
225
|
-
+Net::HTTP
|
226
|
-
+Net::HTTP
|
227
|
-
+Net::HTTP
|
218
|
+
+HTTPClient#get
|
219
|
+
+HTTPClient#head
|
220
|
+
+HTTPClient#delete
|
221
|
+
+HTTPClient#trace
|
222
|
+
+HTTPClient#post
|
223
|
+
+HTTPClient#put
|
224
|
+
+HTTPClient#patch
|
225
|
+
#net-http
|
226
|
+
+Net::HTTP.get_response
|
227
|
+
+Net::HTTP.get
|
228
|
+
+Net::HTTP.head
|
229
|
+
+Net::HTTP.delete
|
230
|
+
+Net::HTTP.trace
|
231
|
+
+Net::HTTP.post
|
232
|
+
+Net::HTTP.put
|
233
|
+
+Net::HTTP.patch
|
234
|
+
+Net::HTTP.post_form
|
228
235
|
}
|
229
236
|
|
230
237
|
QUERIES = %w{
|
231
|
-
#
|
238
|
+
#redis
|
232
239
|
Redis
|
233
|
-
+Redis
|
234
|
-
+Redis
|
235
|
-
+Redis
|
236
|
-
+Redis
|
237
|
-
+Redis
|
238
|
-
+Redis
|
239
|
-
+Redis
|
240
|
-
+Redis
|
241
|
-
+Redis
|
242
|
-
+Redis
|
243
|
-
+Redis
|
244
|
-
+Redis
|
245
|
-
+Redis
|
246
|
-
+Redis
|
247
|
-
+Redis
|
248
|
-
+Redis
|
249
|
-
+Redis
|
250
|
-
+Redis
|
251
|
-
# Revisit this command as greedy matches on Redis.synchronize too
|
240
|
+
+Redis#auth
|
241
|
+
+Redis#select
|
242
|
+
+Redis#ping
|
243
|
+
+Redis#echo
|
244
|
+
+Redis#bgrewriteaof
|
245
|
+
+Redis#bgsave
|
246
|
+
+Redis#config
|
247
|
+
+Redis#dbsize
|
248
|
+
+Redis#debug
|
249
|
+
+Redis#flushall
|
250
|
+
+Redis#flushdb
|
251
|
+
+Redis#info
|
252
|
+
+Redis#lastsave
|
253
|
+
+Redis#monitor
|
254
|
+
+Redis#save
|
255
|
+
+Redis#shutdown
|
256
|
+
+Redis#slave
|
257
|
+
+Redis#slowlog
|
252
258
|
#+Redis::sync
|
253
|
-
+Redis
|
254
|
-
+Redis
|
255
|
-
+Redis
|
256
|
-
+Redis
|
257
|
-
+Redis
|
258
|
-
+Redis
|
259
|
-
+Redis
|
260
|
-
+Redis
|
261
|
-
+Redis
|
262
|
-
+Redis
|
263
|
-
+Redis
|
264
|
-
+Redis
|
265
|
-
+Redis
|
266
|
-
+Redis
|
267
|
-
+Redis
|
268
|
-
+Redis
|
269
|
-
+Redis
|
270
|
-
+Redis
|
271
|
-
+Redis
|
272
|
-
+Redis
|
273
|
-
+Redis
|
274
|
-
+Redis
|
275
|
-
+Redis
|
276
|
-
+Redis
|
277
|
-
+Redis
|
278
|
-
+Redis
|
279
|
-
+Redis
|
280
|
-
+Redis
|
281
|
-
+Redis
|
282
|
-
+Redis
|
283
|
-
+Redis
|
284
|
-
+Redis
|
285
|
-
+Redis
|
286
|
-
+Redis
|
287
|
-
+Redis
|
288
|
-
+Redis
|
289
|
-
+Redis
|
290
|
-
+Redis
|
291
|
-
+Redis
|
292
|
-
+Redis
|
293
|
-
+Redis
|
294
|
-
+Redis
|
295
|
-
+Redis
|
296
|
-
+Redis
|
297
|
-
+Redis
|
298
|
-
+Redis
|
299
|
-
+Redis
|
300
|
-
+Redis
|
301
|
-
+Redis
|
302
|
-
+Redis
|
303
|
-
+Redis
|
304
|
-
+Redis
|
305
|
-
+Redis
|
306
|
-
+Redis
|
307
|
-
+Redis
|
308
|
-
+Redis
|
309
|
-
+Redis
|
310
|
-
+Redis
|
311
|
-
+Redis
|
312
|
-
+Redis
|
313
|
-
+Redis
|
314
|
-
+Redis
|
315
|
-
+Redis
|
316
|
-
+Redis
|
317
|
-
+Redis
|
318
|
-
+Redis
|
319
|
-
+Redis
|
320
|
-
+Redis
|
321
|
-
+Redis
|
322
|
-
+Redis
|
323
|
-
+Redis
|
324
|
-
+Redis
|
325
|
-
+Redis
|
326
|
-
+Redis
|
327
|
-
+Redis
|
328
|
-
+Redis
|
329
|
-
+Redis
|
330
|
-
+Redis
|
331
|
-
+Redis
|
332
|
-
+Redis
|
333
|
-
+Redis
|
334
|
-
+Redis
|
335
|
-
+Redis
|
336
|
-
+Redis
|
337
|
-
+Redis
|
338
|
-
+Redis
|
339
|
-
+Redis
|
340
|
-
+Redis
|
341
|
-
+Redis
|
342
|
-
+Redis
|
343
|
-
+Redis
|
344
|
-
+Redis
|
345
|
-
+Redis
|
346
|
-
+Redis
|
347
|
-
+Redis
|
348
|
-
+Redis
|
349
|
-
+Redis
|
350
|
-
+Redis
|
351
|
-
+Redis
|
352
|
-
+Redis
|
353
|
-
+Redis
|
354
|
-
+Redis
|
355
|
-
+Redis
|
356
|
-
+Redis
|
357
|
-
+Redis
|
358
|
-
+Redis
|
359
|
-
+Redis
|
360
|
-
+Redis
|
361
|
-
+Redis
|
362
|
-
+Redis
|
363
|
-
+Redis
|
364
|
-
+Redis
|
365
|
-
+Redis
|
366
|
-
+Redis
|
367
|
-
+Redis
|
368
|
-
+Redis
|
369
|
-
+Redis
|
370
|
-
+Redis
|
371
|
-
+Redis
|
372
|
-
+Redis
|
373
|
-
+Redis
|
374
|
-
+Redis
|
375
|
-
+Redis
|
376
|
-
+Redis
|
377
|
-
+Redis
|
378
|
-
+Redis
|
379
|
-
+Redis
|
380
|
-
+Redis
|
381
|
-
+Redis
|
382
|
-
+Redis
|
383
|
-
+Redis
|
384
|
-
+Redis
|
385
|
-
+Redis
|
386
|
-
+Redis
|
387
|
-
+Redis
|
388
|
-
+Redis
|
389
|
-
+Redis
|
390
|
-
+Redis
|
391
|
-
+Redis
|
392
|
-
+Redis
|
393
|
-
+Redis
|
394
|
-
+Redis
|
395
|
-
+Redis
|
396
|
-
+Redis
|
397
|
-
+Redis
|
398
|
-
+Redis
|
399
|
-
+Redis
|
400
|
-
+Redis
|
401
|
-
+Redis
|
402
|
-
+Redis
|
403
|
-
+Redis
|
404
|
-
+Redis
|
405
|
-
+Redis
|
406
|
-
+Redis
|
407
|
-
+Redis
|
408
|
-
+Redis
|
409
|
-
+Redis
|
410
|
-
+Redis
|
411
|
-
+Redis
|
412
|
-
+Redis
|
413
|
-
+Redis
|
414
|
-
+Redis
|
415
|
-
+Redis
|
416
|
-
+Redis
|
417
|
-
+Redis
|
418
|
-
#+Raygun::Apm::Hooks::Redis::process
|
259
|
+
+Redis#time
|
260
|
+
+Redis#persist
|
261
|
+
+Redis#expire
|
262
|
+
+Redis#expireat
|
263
|
+
+Redis#ttl
|
264
|
+
+Redis#pexpire
|
265
|
+
+Redis#pexpireat
|
266
|
+
+Redis#pttl
|
267
|
+
+Redis#dump
|
268
|
+
+Redis#restore
|
269
|
+
+Redis#migrate
|
270
|
+
+Redis#del
|
271
|
+
+Redis#unlink
|
272
|
+
+Redis#exists
|
273
|
+
+Redis#keys
|
274
|
+
+Redis#move
|
275
|
+
+Redis#object
|
276
|
+
+Redis#randomkey
|
277
|
+
+Redis#rename
|
278
|
+
+Redis#renamenx
|
279
|
+
+Redis#sort
|
280
|
+
+Redis#type
|
281
|
+
+Redis#decr
|
282
|
+
+Redis#decrby
|
283
|
+
+Redis#incr
|
284
|
+
+Redis#incrby
|
285
|
+
+Redis#incrbyfloat
|
286
|
+
+Redis#set
|
287
|
+
+Redis#multi
|
288
|
+
+Redis#client
|
289
|
+
+Redis#set
|
290
|
+
+Redis#setex
|
291
|
+
+Redis#psetex
|
292
|
+
+Redis#setnx
|
293
|
+
+Redis#mset
|
294
|
+
+Redis#mapped_mset
|
295
|
+
+Redis#msetnx
|
296
|
+
+Redis#mapped_msetnx
|
297
|
+
+Redis#get
|
298
|
+
+Redis#mget
|
299
|
+
+Redis#mapped_mget
|
300
|
+
+Redis#setrange
|
301
|
+
+Redis#getrange
|
302
|
+
+Redis#setbit
|
303
|
+
+Redis#getbit
|
304
|
+
+Redis#append
|
305
|
+
+Redis#bitcount
|
306
|
+
+Redis#bitop
|
307
|
+
+Redis#bitpos
|
308
|
+
+Redis#getset
|
309
|
+
+Redis#strlen
|
310
|
+
+Redis#llen
|
311
|
+
+Redis#lpush
|
312
|
+
+Redis#lpushx
|
313
|
+
+Redis#rpush
|
314
|
+
+Redis#rpushx
|
315
|
+
+Redis#lpop
|
316
|
+
+Redis#rpop
|
317
|
+
+Redis#rpoplpush
|
318
|
+
+Redis#blpop
|
319
|
+
+Redis#brpop
|
320
|
+
+Redis#brpoplpush
|
321
|
+
+Redis#lindex
|
322
|
+
+Redis#linsert
|
323
|
+
+Redis#lrange
|
324
|
+
+Redis#lrem
|
325
|
+
+Redis#lset
|
326
|
+
+Redis#ltrim
|
327
|
+
+Redis#scard
|
328
|
+
+Redis#sadd
|
329
|
+
+Redis#srem
|
330
|
+
+Redis#spop
|
331
|
+
+Redis#srandmember
|
332
|
+
+Redis#smove
|
333
|
+
+Redis#sismember
|
334
|
+
+Redis#smembers
|
335
|
+
+Redis#sdiff
|
336
|
+
+Redis#sdiffstore
|
337
|
+
+Redis#sinter
|
338
|
+
+Redis#sinterstore
|
339
|
+
+Redis#sunion
|
340
|
+
+Redis#sunionstore
|
341
|
+
+Redis#zcard
|
342
|
+
+Redis#zadd
|
343
|
+
+Redis#zincrby
|
344
|
+
+Redis#zrem
|
345
|
+
+Redis#zpopmax
|
346
|
+
+Redis#zpopmin
|
347
|
+
+Redis#bzpopmax
|
348
|
+
+Redis#bzpopmin
|
349
|
+
+Redis#zscore
|
350
|
+
+Redis#zrange
|
351
|
+
+Redis#zrevrange
|
352
|
+
+Redis#zrank
|
353
|
+
+Redis#zrevrank
|
354
|
+
+Redis#zremrangebyrank
|
355
|
+
+Redis#zlexcount
|
356
|
+
+Redis#zrangebylex
|
357
|
+
+Redis#zrevrangebylex
|
358
|
+
+Redis#zrangebyscore
|
359
|
+
+Redis#zrevrangebyscore
|
360
|
+
+Redis#zremrangebyscore
|
361
|
+
+Redis#zcount
|
362
|
+
+Redis#zinterstore
|
363
|
+
+Redis#zunionstore
|
364
|
+
+Redis#hlen
|
365
|
+
+Redis#hset
|
366
|
+
+Redis#hsetnx
|
367
|
+
+Redis#hmset
|
368
|
+
+Redis#mapped_hmset
|
369
|
+
+Redis#hget
|
370
|
+
+Redis#hmget
|
371
|
+
+Redis#mapped_hmget
|
372
|
+
+Redis#hdel
|
373
|
+
+Redis#hexists
|
374
|
+
+Redis#hincrby
|
375
|
+
+Redis#hincrbyfloat
|
376
|
+
+Redis#hkeys
|
377
|
+
+Redis#hvals
|
378
|
+
+Redis#hgetall
|
379
|
+
+Redis#publish
|
380
|
+
+Redis#subscribe
|
381
|
+
+Redis#subscribe_with_timeout
|
382
|
+
+Redis#unsubscribe
|
383
|
+
+Redis#psubscribe
|
384
|
+
+Redis#psubscribe_with_timeout
|
385
|
+
+Redis#punsubscribe
|
386
|
+
+Redis#pubsub
|
387
|
+
+Redis#watch
|
388
|
+
+Redis#unwatch
|
389
|
+
+Redis#pipelined
|
390
|
+
+Redis#multi
|
391
|
+
+Redis#exec
|
392
|
+
+Redis#discard
|
393
|
+
+Redis#script
|
394
|
+
+Redis#eval
|
395
|
+
+Redis#evalsha
|
396
|
+
+Redis#scan
|
397
|
+
+Redis#hscan
|
398
|
+
+Redis#zscan
|
399
|
+
+Redis#sscan
|
400
|
+
+Redis#pfadd
|
401
|
+
+Redis#pfcount
|
402
|
+
+Redis#pfmerge
|
403
|
+
+Redis#geoadd
|
404
|
+
+Redis#geohash
|
405
|
+
+Redis#georadiusbymember
|
406
|
+
+Redis#geopos
|
407
|
+
+Redis#geodist
|
408
|
+
+Redis#xinfo
|
409
|
+
+Redis#xadd
|
410
|
+
+Redis#xtrim
|
411
|
+
+Redis#xdel
|
412
|
+
+Redis#xrange
|
413
|
+
+Redis#xrevrange
|
414
|
+
+Redis#xlen
|
415
|
+
+Redis#xread
|
416
|
+
+Redis#xgroup
|
417
|
+
+Redis#xreadgroup
|
418
|
+
+Redis#xack
|
419
|
+
+Redis#xclaim
|
420
|
+
+Redis#xpending
|
421
|
+
+Redis#sentinel
|
422
|
+
+Redis#cluster
|
423
|
+
+Redis#asking
|
419
424
|
}
|
420
425
|
|
421
426
|
RAYGUN4RUBY = %w{
|
422
427
|
Raygun::Breadcrumbs
|
423
428
|
Raygun::Configuration
|
424
|
-
Raygun
|
425
|
-
Raygun
|
426
|
-
Raygun
|
429
|
+
Raygun.config
|
430
|
+
Raygun.log
|
431
|
+
Raygun.should_report?
|
427
432
|
Raygun::Client
|
428
433
|
track_exception_sync
|
429
|
-
+Raygun
|
434
|
+
+Raygun.track_exception
|
430
435
|
}
|
431
436
|
|
432
437
|
def self.extend_with(list)
|
@@ -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})"
|
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
|
data/lib/raygun/apm/tracer.rb
CHANGED
@@ -18,43 +18,15 @@ module Raygun
|
|
18
18
|
attr_accessor :config
|
19
19
|
|
20
20
|
def initialize(env=ENV)
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
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
|
75
|
+
def run_agent_connectivity_diagnostics
|
78
76
|
check = Raygun::Apm::Diagnostics.new
|
79
77
|
check.verify_agent
|
80
78
|
end
|
data/lib/raygun/apm/version.rb
CHANGED
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.
|
4
|
+
version: 1.0.44
|
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-
|
12
|
+
date: 2020-06-17 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
|