raygun-apm 1.0.39-x64-mingw32 → 1.0.44-x64-mingw32
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.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 +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 +37 -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: f8ffbc0b814de3db83166d306b137963069ace821e7c2ee8c0861170db61f32d
|
4
|
+
data.tar.gz: c4d890e108e36f5790b728d03c0d6ba28d080dfab3d0391bb021861ffa2b0d2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4fbc90c84a10fd95191a5c8d109ae27fda05c5cc69e26d674a1e9bec714f305cfbeb6f669e3016af40353d826dac0eb3d586fd08a891e282a35338492baa744
|
7
|
+
data.tar.gz: 03f8ff8d4d9e40563cb6ef43a09082127990bdf21c72eca23aba97049ccd4694fa43ea26e6ed402a23b6e7f913cb882af56baeb36bbb5fc21bb51c422ab77526
|
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,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,75 +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
|
239
|
+
Redis
|
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
|
258
|
+
#+Redis::sync
|
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
|
424
|
+
}
|
425
|
+
|
426
|
+
RAYGUN4RUBY = %w{
|
427
|
+
Raygun::Breadcrumbs
|
428
|
+
Raygun::Configuration
|
429
|
+
Raygun.config
|
430
|
+
Raygun.log
|
431
|
+
Raygun.should_report?
|
432
|
+
Raygun::Client
|
433
|
+
track_exception_sync
|
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})"
|
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
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'raygun/apm/blacklist'
|
2
|
+
require 'rbconfig'
|
2
3
|
|
3
4
|
module Raygun
|
4
5
|
module Apm
|
@@ -17,42 +18,15 @@ module Raygun
|
|
17
18
|
attr_accessor :config
|
18
19
|
|
19
20
|
def initialize(env=ENV)
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
[]
|
25
|
-
end
|
26
|
-
add_filters @blacklist
|
27
|
-
# Ignore comments set to false here to account for #<Class: etc. in Rails blacklist
|
28
|
-
add_filters Raygun::Apm::Blacklist.resolve_entries, ignore_comments: false
|
29
|
-
show_filters if config.loglevel == Tracer::LOG_BLACKLIST
|
30
|
-
# Special assignments from config to the Tracer
|
31
|
-
self.log_level = config.loglevel
|
32
|
-
self.environment = config.environment
|
33
|
-
self.api_key = config.proton_api_key
|
34
|
-
self.register_libraries Bundler.load.specs.map(&:full_gem_path).sort
|
21
|
+
configure(env)
|
22
|
+
initialize_blacklist
|
23
|
+
register_known_library_paths
|
24
|
+
run_agent_connectivity_diagnostics
|
35
25
|
ObjectSpace.define_finalizer(self, proc{ disable_tracepoints })
|
36
26
|
# Any fails here is kamikaze for the tracer
|
37
27
|
rescue => e
|
38
28
|
# XXX works for the middleware wrapped case, not for standalone - revisit
|
39
|
-
raise Raygun::Apm::FatalError, "Raygun APM tracer could not be initialized: #{e.message}"
|
40
|
-
end
|
41
|
-
|
42
|
-
def add_filters(filters, ignore_comments: true)
|
43
|
-
filters.each do |filter|
|
44
|
-
filter.strip!
|
45
|
-
# comment
|
46
|
-
if filter.start_with?('#')
|
47
|
-
add_blacklist filter unless ignore_comments
|
48
|
-
elsif filter.start_with?('+')
|
49
|
-
add_whitelist filter[1..-1]
|
50
|
-
elsif filter.start_with?('-')
|
51
|
-
add_blacklist filter[1..-1]
|
52
|
-
elsif filter.size > 0
|
53
|
-
add_blacklist filter
|
54
|
-
end
|
55
|
-
end
|
29
|
+
raise Raygun::Apm::FatalError, "Raygun APM tracer could not be initialized: #{e.message} #{e.backtrace.join("\n")}"
|
56
30
|
end
|
57
31
|
|
58
32
|
def udp_sink!
|
@@ -69,9 +43,39 @@ module Raygun
|
|
69
43
|
# Any fails here is kamikaze for the tracer
|
70
44
|
rescue => e
|
71
45
|
# XXX works for the middleware wrapped case, not for standalone - revisit
|
72
|
-
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
|
73
56
|
end
|
74
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']
|
73
|
+
end
|
74
|
+
|
75
|
+
def run_agent_connectivity_diagnostics
|
76
|
+
check = Raygun::Apm::Diagnostics.new
|
77
|
+
check.verify_agent
|
78
|
+
end
|
75
79
|
end
|
76
80
|
end
|
77
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.44
|
5
5
|
platform: x64-mingw32
|
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-17 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.so
|
@@ -210,7 +211,10 @@ files:
|
|
210
211
|
- lib/raygun/2.7/raygun_ext.so
|
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
|