raygun-apm 1.0.40-universal-darwin → 1.0.45-universal-darwin
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 +4 -4
- data/bin/diagnostics +7 -0
- data/ext/raygun/extconf.rb +1 -0
- data/lib/raygun/2.5/raygun_ext.bundle +0 -0
- data/lib/raygun/2.6/raygun_ext.bundle +0 -0
- data/lib/raygun/2.7/raygun_ext.bundle +0 -0
- data/lib/raygun/apm.rb +3 -0
- data/lib/raygun/apm/blacklist.rb +248 -45
- data/lib/raygun/apm/blacklist/parser.rb +47 -0
- data/lib/raygun/apm/blacklist/translator.rb +73 -0
- data/lib/raygun/apm/config.rb +2 -1
- data/lib/raygun/apm/diagnostics.rb +34 -0
- data/lib/raygun/apm/event.rb +1 -1
- data/lib/raygun/apm/tracer.rb +36 -33
- data/lib/raygun/apm/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a69112df114da8dc5aa184958c9f3a2b08ba68861767f9780cfa5d3578bd2111
|
4
|
+
data.tar.gz: e6a11dd13505a1c797e6607c79ed612b632f519833106f250dee3150088efb88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf298c37c2d45e2cc65b164fac061c1c3f50938597c1b0ab9213196a2080c3156abc9bb77b8bfdfe931dee6ed176c5420612584495cb6e5e8c51781771fe603e
|
7
|
+
data.tar.gz: dc35642632fba924346b492a9224b5f02022da19a9252ca2f53428ed0ea6fb5e17188d90b32a3cd59b8f7e1d4d075b0282dc3d6c7553dbbf1fb67208276f4972
|
data/bin/diagnostics
ADDED
data/ext/raygun/extconf.rb
CHANGED
Binary file
|
Binary file
|
Binary file
|
data/lib/raygun/apm.rb
CHANGED
@@ -6,6 +6,9 @@ rescue LoadError
|
|
6
6
|
require "raygun/raygun_ext"
|
7
7
|
end
|
8
8
|
require "raygun/apm/config"
|
9
|
+
require "raygun/apm/diagnostics"
|
10
|
+
require "raygun/apm/blacklist/parser"
|
11
|
+
require "raygun/apm/blacklist/translator"
|
9
12
|
require "raygun/apm/tracer"
|
10
13
|
require "raygun/apm/event"
|
11
14
|
require "raygun/apm/hooks/net_http"
|
data/lib/raygun/apm/blacklist.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
module Raygun
|
2
2
|
module Apm
|
3
|
-
|
3
|
+
module Blacklist
|
4
4
|
PROFILER = %w{
|
5
|
+
Raygun
|
5
6
|
Raygun::Apm::
|
6
7
|
}
|
7
8
|
|
@@ -78,7 +79,7 @@ module Raygun
|
|
78
79
|
MatchData
|
79
80
|
Math
|
80
81
|
Math::DomainError
|
81
|
-
Method
|
82
|
+
Method#
|
82
83
|
Module
|
83
84
|
Mutex
|
84
85
|
NameError
|
@@ -160,75 +161,277 @@ module Raygun
|
|
160
161
|
Delegator
|
161
162
|
PrettyPrint
|
162
163
|
PP
|
164
|
+
Minitest
|
163
165
|
}
|
164
166
|
|
165
167
|
HTTP_OUT = %w{
|
166
|
-
#
|
168
|
+
#Faraday
|
167
169
|
URI
|
168
170
|
MonitorMixin
|
169
171
|
Faraday
|
170
|
-
+Faraday::Connection
|
171
|
-
+Faraday::Connection
|
172
|
-
+Faraday::Connection
|
173
|
-
+Faraday::Connection
|
174
|
-
+Faraday::Connection
|
175
|
-
+Faraday::Connection
|
176
|
-
+Faraday::Connection
|
172
|
+
+Faraday::Connection#get
|
173
|
+
+Faraday::Connection#head
|
174
|
+
+Faraday::Connection#delete
|
175
|
+
+Faraday::Connection#trace
|
176
|
+
+Faraday::Connection#post
|
177
|
+
+Faraday::Connection#put
|
178
|
+
+Faraday::Connection#patch
|
177
179
|
#multipart-post
|
178
180
|
Multipartable
|
179
181
|
SecureRandom
|
180
182
|
Parts
|
181
183
|
CompositeReadIO
|
182
|
-
+Multipartable
|
184
|
+
+Multipartable#initialize
|
183
185
|
#rest-client
|
184
186
|
RestClient
|
185
187
|
Netrc
|
186
188
|
HTTP::CookieJar
|
187
189
|
DomainName
|
188
190
|
HTTP::Accept
|
189
|
-
+RestClient
|
190
|
-
+RestClient
|
191
|
-
+RestClient
|
192
|
-
+RestClient
|
193
|
-
+RestClient
|
194
|
-
+RestClient
|
195
|
-
+RestClient
|
191
|
+
+RestClient.get
|
192
|
+
+RestClient.head
|
193
|
+
+RestClient.delete
|
194
|
+
+RestClient.trace
|
195
|
+
+RestClient.post
|
196
|
+
+RestClient.put
|
197
|
+
+RestClient.patch
|
196
198
|
#excon
|
197
199
|
Excon
|
198
|
-
+Excon
|
199
|
-
+Excon
|
200
|
-
+Excon
|
201
|
-
+Excon
|
202
|
-
+Excon
|
203
|
-
+Excon
|
204
|
-
+Excon
|
200
|
+
+Excon.get
|
201
|
+
+Excon.head
|
202
|
+
+Excon.delete
|
203
|
+
+Excon.trace
|
204
|
+
+Excon.post
|
205
|
+
+Excon.put
|
206
|
+
+Excon.patch
|
205
207
|
#HTTParty
|
206
208
|
HTTParty
|
207
|
-
+HTTParty
|
208
|
-
+HTTParty
|
209
|
-
+HTTParty
|
210
|
-
+HTTParty
|
211
|
-
+HTTParty
|
212
|
-
+HTTParty
|
213
|
-
+HTTParty
|
209
|
+
+HTTParty.get
|
210
|
+
+HTTParty.head
|
211
|
+
+HTTParty.delete
|
212
|
+
+HTTParty.trace
|
213
|
+
+HTTParty.post
|
214
|
+
+HTTParty.put
|
215
|
+
+HTTParty.patch
|
214
216
|
#httpclient
|
215
217
|
HTTPClient
|
216
218
|
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
|
219
|
+
+HTTPClient#get
|
220
|
+
+HTTPClient#head
|
221
|
+
+HTTPClient#delete
|
222
|
+
+HTTPClient#trace
|
223
|
+
+HTTPClient#post
|
224
|
+
+HTTPClient#put
|
225
|
+
+HTTPClient#patch
|
226
|
+
#net-http
|
227
|
+
+Net::HTTP.get_response
|
228
|
+
+Net::HTTP.get
|
229
|
+
+Net::HTTP.head
|
230
|
+
+Net::HTTP.delete
|
231
|
+
+Net::HTTP.trace
|
232
|
+
+Net::HTTP.post
|
233
|
+
+Net::HTTP.put
|
234
|
+
+Net::HTTP.patch
|
235
|
+
+Net::HTTP.post_form
|
228
236
|
}
|
229
237
|
|
230
238
|
QUERIES = %w{
|
231
|
-
|
239
|
+
#redis
|
240
|
+
Redis
|
241
|
+
+Redis#auth
|
242
|
+
+Redis#select
|
243
|
+
+Redis#ping
|
244
|
+
+Redis#echo
|
245
|
+
+Redis#bgrewriteaof
|
246
|
+
+Redis#bgsave
|
247
|
+
+Redis#config
|
248
|
+
+Redis#dbsize
|
249
|
+
+Redis#debug
|
250
|
+
+Redis#flushall
|
251
|
+
+Redis#flushdb
|
252
|
+
+Redis#info
|
253
|
+
+Redis#lastsave
|
254
|
+
+Redis#monitor
|
255
|
+
+Redis#save
|
256
|
+
+Redis#shutdown
|
257
|
+
+Redis#slave
|
258
|
+
+Redis#slowlog
|
259
|
+
+Redis#sync
|
260
|
+
+Redis#time
|
261
|
+
+Redis#persist
|
262
|
+
+Redis#expire
|
263
|
+
+Redis#expireat
|
264
|
+
+Redis#ttl
|
265
|
+
+Redis#pexpire
|
266
|
+
+Redis#pexpireat
|
267
|
+
+Redis#pttl
|
268
|
+
+Redis#dump
|
269
|
+
+Redis#restore
|
270
|
+
+Redis#migrate
|
271
|
+
+Redis#del
|
272
|
+
+Redis#unlink
|
273
|
+
+Redis#exists
|
274
|
+
+Redis#keys
|
275
|
+
+Redis#move
|
276
|
+
+Redis#object
|
277
|
+
+Redis#randomkey
|
278
|
+
+Redis#rename
|
279
|
+
+Redis#renamenx
|
280
|
+
+Redis#sort
|
281
|
+
+Redis#type
|
282
|
+
+Redis#decr
|
283
|
+
+Redis#decrby
|
284
|
+
+Redis#incr
|
285
|
+
+Redis#incrby
|
286
|
+
+Redis#incrbyfloat
|
287
|
+
+Redis#set
|
288
|
+
+Redis#multi
|
289
|
+
+Redis#client
|
290
|
+
+Redis#set
|
291
|
+
+Redis#setex
|
292
|
+
+Redis#psetex
|
293
|
+
+Redis#setnx
|
294
|
+
+Redis#mset
|
295
|
+
+Redis#mapped_mset
|
296
|
+
+Redis#msetnx
|
297
|
+
+Redis#mapped_msetnx
|
298
|
+
+Redis#get
|
299
|
+
+Redis#mget
|
300
|
+
+Redis#mapped_mget
|
301
|
+
+Redis#setrange
|
302
|
+
+Redis#getrange
|
303
|
+
+Redis#setbit
|
304
|
+
+Redis#getbit
|
305
|
+
+Redis#append
|
306
|
+
+Redis#bitcount
|
307
|
+
+Redis#bitop
|
308
|
+
+Redis#bitpos
|
309
|
+
+Redis#getset
|
310
|
+
+Redis#strlen
|
311
|
+
+Redis#llen
|
312
|
+
+Redis#lpush
|
313
|
+
+Redis#lpushx
|
314
|
+
+Redis#rpush
|
315
|
+
+Redis#rpushx
|
316
|
+
+Redis#lpop
|
317
|
+
+Redis#rpop
|
318
|
+
+Redis#rpoplpush
|
319
|
+
+Redis#blpop
|
320
|
+
+Redis#brpop
|
321
|
+
+Redis#brpoplpush
|
322
|
+
+Redis#lindex
|
323
|
+
+Redis#linsert
|
324
|
+
+Redis#lrange
|
325
|
+
+Redis#lrem
|
326
|
+
+Redis#lset
|
327
|
+
+Redis#ltrim
|
328
|
+
+Redis#scard
|
329
|
+
+Redis#sadd
|
330
|
+
+Redis#srem
|
331
|
+
+Redis#spop
|
332
|
+
+Redis#srandmember
|
333
|
+
+Redis#smove
|
334
|
+
+Redis#sismember
|
335
|
+
+Redis#smembers
|
336
|
+
+Redis#sdiff
|
337
|
+
+Redis#sdiffstore
|
338
|
+
+Redis#sinter
|
339
|
+
+Redis#sinterstore
|
340
|
+
+Redis#sunion
|
341
|
+
+Redis#sunionstore
|
342
|
+
+Redis#zcard
|
343
|
+
+Redis#zadd
|
344
|
+
+Redis#zincrby
|
345
|
+
+Redis#zrem
|
346
|
+
+Redis#zpopmax
|
347
|
+
+Redis#zpopmin
|
348
|
+
+Redis#bzpopmax
|
349
|
+
+Redis#bzpopmin
|
350
|
+
+Redis#zscore
|
351
|
+
+Redis#zrange
|
352
|
+
+Redis#zrevrange
|
353
|
+
+Redis#zrank
|
354
|
+
+Redis#zrevrank
|
355
|
+
+Redis#zremrangebyrank
|
356
|
+
+Redis#zlexcount
|
357
|
+
+Redis#zrangebylex
|
358
|
+
+Redis#zrevrangebylex
|
359
|
+
+Redis#zrangebyscore
|
360
|
+
+Redis#zrevrangebyscore
|
361
|
+
+Redis#zremrangebyscore
|
362
|
+
+Redis#zcount
|
363
|
+
+Redis#zinterstore
|
364
|
+
+Redis#zunionstore
|
365
|
+
+Redis#hlen
|
366
|
+
+Redis#hset
|
367
|
+
+Redis#hsetnx
|
368
|
+
+Redis#hmset
|
369
|
+
+Redis#mapped_hmset
|
370
|
+
+Redis#hget
|
371
|
+
+Redis#hmget
|
372
|
+
+Redis#mapped_hmget
|
373
|
+
+Redis#hdel
|
374
|
+
+Redis#hexists
|
375
|
+
+Redis#hincrby
|
376
|
+
+Redis#hincrbyfloat
|
377
|
+
+Redis#hkeys
|
378
|
+
+Redis#hvals
|
379
|
+
+Redis#hgetall
|
380
|
+
+Redis#publish
|
381
|
+
+Redis#subscribe
|
382
|
+
+Redis#subscribe_with_timeout
|
383
|
+
+Redis#unsubscribe
|
384
|
+
+Redis#psubscribe
|
385
|
+
+Redis#psubscribe_with_timeout
|
386
|
+
+Redis#punsubscribe
|
387
|
+
+Redis#pubsub
|
388
|
+
+Redis#watch
|
389
|
+
+Redis#unwatch
|
390
|
+
+Redis#pipelined
|
391
|
+
+Redis#multi
|
392
|
+
+Redis#exec
|
393
|
+
+Redis#discard
|
394
|
+
+Redis#script
|
395
|
+
+Redis#eval
|
396
|
+
+Redis#evalsha
|
397
|
+
+Redis#scan
|
398
|
+
+Redis#hscan
|
399
|
+
+Redis#zscan
|
400
|
+
+Redis#sscan
|
401
|
+
+Redis#pfadd
|
402
|
+
+Redis#pfcount
|
403
|
+
+Redis#pfmerge
|
404
|
+
+Redis#geoadd
|
405
|
+
+Redis#geohash
|
406
|
+
+Redis#georadiusbymember
|
407
|
+
+Redis#geopos
|
408
|
+
+Redis#geodist
|
409
|
+
+Redis#xinfo
|
410
|
+
+Redis#xadd
|
411
|
+
+Redis#xtrim
|
412
|
+
+Redis#xdel
|
413
|
+
+Redis#xrange
|
414
|
+
+Redis#xrevrange
|
415
|
+
+Redis#xlen
|
416
|
+
+Redis#xread
|
417
|
+
+Redis#xgroup
|
418
|
+
+Redis#xreadgroup
|
419
|
+
+Redis#xack
|
420
|
+
+Redis#xclaim
|
421
|
+
+Redis#xpending
|
422
|
+
+Redis#sentinel
|
423
|
+
+Redis#cluster
|
424
|
+
+Redis#asking
|
425
|
+
}
|
426
|
+
|
427
|
+
RAYGUN4RUBY = %w{
|
428
|
+
Raygun::Breadcrumbs
|
429
|
+
Raygun::Configuration
|
430
|
+
Raygun.config
|
431
|
+
Raygun.log
|
432
|
+
Raygun.should_report?
|
433
|
+
Raygun::Client
|
434
|
+
+Raygun.track_exception
|
232
435
|
}
|
233
436
|
|
234
437
|
def self.extend_with(list)
|
@@ -240,7 +443,7 @@ module Raygun
|
|
240
443
|
end
|
241
444
|
|
242
445
|
def self.resolve_entries
|
243
|
-
DEFAULT_RUBY + PROFILER + HTTP_OUT + QUERIES + self.extended_blacklist.flatten
|
446
|
+
DEFAULT_RUBY + PROFILER + HTTP_OUT + QUERIES + RAYGUN4RUBY + self.extended_blacklist.flatten
|
244
447
|
end
|
245
448
|
end
|
246
449
|
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
|
data/lib/raygun/apm/config.rb
CHANGED
@@ -49,9 +49,10 @@ module Raygun
|
|
49
49
|
end
|
50
50
|
|
51
51
|
# Initial constants for ProtonAgentTail.exe
|
52
|
-
UDP_SINK_HOST = '127.0.0.1'
|
52
|
+
UDP_SINK_HOST = TCP_MANAGEMENT_HOST = '127.0.0.1'
|
53
53
|
UDP_SINK_MULTICAST_HOST = '239.100.15.215'
|
54
54
|
UDP_SINK_PORT = 2799
|
55
|
+
TCP_MANAGEMENT_PORT = 2790
|
55
56
|
|
56
57
|
## Enumerate all PROTON_ constants
|
57
58
|
config_var 'PROTON_API_KEY', as: String, default: ''
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require "socket"
|
2
|
+
require "json"
|
3
|
+
|
4
|
+
module Raygun
|
5
|
+
module Apm
|
6
|
+
class Diagnostics
|
7
|
+
AGENT_STATE_DOWN = "The Raygun APM Agent appears to not be running on the current host.\nIf not already installed, please consult https://raygun.com/documentation/product-guides/apm/agent/downloads/\nOtherwise refer to https://raygun.com/documentation/product-guides/apm/agent/installation/ for starting the Agent."
|
8
|
+
AGENT_STATE_UP_MISCONFIGURED = "The Raygun APM Agent is running, but misconfigured.\nThe API Key needs to be set through the Raygun_ApiKey environment variable.\nThe API key can be found under 'Application Settings' in the Raygun UI"
|
9
|
+
AGENT_STATE_UP_CONFIGURED = "The Raygun APM Agent is configured properly!"
|
10
|
+
|
11
|
+
def initialize(host: Apm::Config::TCP_MANAGEMENT_HOST, port: Apm::Config::TCP_MANAGEMENT_PORT)
|
12
|
+
@host = host
|
13
|
+
@port = port
|
14
|
+
end
|
15
|
+
|
16
|
+
def verify_agent
|
17
|
+
socket.write "GetAgentInfo"
|
18
|
+
response = JSON.parse(socket.gets)
|
19
|
+
if response['Status'] == 1
|
20
|
+
puts AGENT_STATE_UP_CONFIGURED
|
21
|
+
elsif response['Status'] == 0
|
22
|
+
puts AGENT_STATE_UP_MISCONFIGURED
|
23
|
+
end
|
24
|
+
rescue Errno::ECONNREFUSED
|
25
|
+
puts AGENT_STATE_DOWN
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
def socket
|
30
|
+
@socket ||= s = TCPSocket.new(@host, @port)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
data/lib/raygun/apm/event.rb
CHANGED
data/lib/raygun/apm/tracer.rb
CHANGED
@@ -18,42 +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']
|
21
|
+
configure(env)
|
22
|
+
initialize_blacklist
|
23
|
+
register_known_library_paths
|
24
|
+
run_agent_connectivity_diagnostics
|
36
25
|
ObjectSpace.define_finalizer(self, proc{ disable_tracepoints })
|
37
26
|
# Any fails here is kamikaze for the tracer
|
38
27
|
rescue => e
|
39
28
|
# XXX works for the middleware wrapped case, not for standalone - revisit
|
40
|
-
raise Raygun::Apm::FatalError, "Raygun APM tracer could not be initialized: #{e.message}"
|
41
|
-
end
|
42
|
-
|
43
|
-
def add_filters(filters, ignore_comments: true)
|
44
|
-
filters.each do |filter|
|
45
|
-
filter.strip!
|
46
|
-
# comment
|
47
|
-
if filter.start_with?('#')
|
48
|
-
add_blacklist filter unless ignore_comments
|
49
|
-
elsif filter.start_with?('+')
|
50
|
-
add_whitelist filter[1..-1]
|
51
|
-
elsif filter.start_with?('-')
|
52
|
-
add_blacklist filter[1..-1]
|
53
|
-
elsif filter.size > 0
|
54
|
-
add_blacklist filter
|
55
|
-
end
|
56
|
-
end
|
29
|
+
raise Raygun::Apm::FatalError, "Raygun APM tracer could not be initialized: #{e.message} #{e.backtrace.join("\n")}"
|
57
30
|
end
|
58
31
|
|
59
32
|
def udp_sink!
|
@@ -70,9 +43,39 @@ module Raygun
|
|
70
43
|
# Any fails here is kamikaze for the tracer
|
71
44
|
rescue => e
|
72
45
|
# XXX works for the middleware wrapped case, not for standalone - revisit
|
73
|
-
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
|
74
69
|
end
|
75
70
|
|
71
|
+
def register_known_library_paths
|
72
|
+
self.register_libraries Bundler.load.specs.map(&:full_gem_path).sort << RbConfig::CONFIG['rubylibdir']
|
73
|
+
end
|
74
|
+
|
75
|
+
def run_agent_connectivity_diagnostics
|
76
|
+
check = Raygun::Apm::Diagnostics.new
|
77
|
+
check.verify_agent
|
78
|
+
end
|
76
79
|
end
|
77
80
|
end
|
78
81
|
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.45
|
5
5
|
platform: universal-darwin
|
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-
|
12
|
+
date: 2020-06-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: debase-ruby_core_source
|
@@ -203,6 +203,7 @@ extra_rdoc_files: []
|
|
203
203
|
files:
|
204
204
|
- README.rdoc
|
205
205
|
- bin/console
|
206
|
+
- bin/diagnostics
|
206
207
|
- bin/setup
|
207
208
|
- ext/raygun/extconf.rb
|
208
209
|
- lib/raygun/2.5/raygun_ext.bundle
|
@@ -210,7 +211,10 @@ files:
|
|
210
211
|
- lib/raygun/2.7/raygun_ext.bundle
|
211
212
|
- lib/raygun/apm.rb
|
212
213
|
- lib/raygun/apm/blacklist.rb
|
214
|
+
- lib/raygun/apm/blacklist/parser.rb
|
215
|
+
- lib/raygun/apm/blacklist/translator.rb
|
213
216
|
- lib/raygun/apm/config.rb
|
217
|
+
- lib/raygun/apm/diagnostics.rb
|
214
218
|
- lib/raygun/apm/event.rb
|
215
219
|
- lib/raygun/apm/hooks/net_http.rb
|
216
220
|
- lib/raygun/apm/hooks/redis.rb
|