raygun-apm 1.0.41-x86-linux → 1.0.46-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: 819d1cf66cdd810a2f6b0d55add2589df3507768a7bf77235bddf5c1df4c204f
4
- data.tar.gz: 91e704d0a1a194c8907068584ca1814ca3d28ac2e47751b0f7357af553881f62
3
+ metadata.gz: 47dfe411421250af598e42e39d872aeae9c4474564ecdf949305b387352fb54c
4
+ data.tar.gz: 62328cfb3a6ba83b7bb3e36279cc2e8f9d8ce6a922a67d7bcd2816d7e9cc8322
5
5
  SHA512:
6
- metadata.gz: 5a18c2f32cbdf5b3c18458efe6270fe9457d236a31988fee866704a5d4d3ab69c5e62a097a4d616a6434f83296fb1967ee4038d95d2f6f7700c09d7bfcae32a1
7
- data.tar.gz: 7635097842d6276056eaeea8b90bc2f15b7baebbac5a9fe406feb97a80740dc43f26dcc9a6de3f275cd0f22feca504ba03a260edeb1c20115edfa68dae96d1bd
6
+ metadata.gz: 676779cb3c767d1e9ffed178cc8e4001ba07d1726aa167f933888dbe9b6ed898f6425f74a380cbf33ed91eaa530e8e2b071c2348ce80ca0648a5c26ab823b44a
7
+ data.tar.gz: 61c53690f29abd822a124380535b78d97c15fc5077581a02b2655b0dfbc9c8332cd199efda56faa7e37e9261ad97cf22a6332766f1a5d9168e03fb403f9f2a15
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "raygun/apm"
5
+
6
+ check = Raygun::Apm::Diagnostics.new
7
+ check.verify_agent
@@ -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
@@ -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"
@@ -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,409 @@ 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::
163
148
  }
164
149
 
165
150
  HTTP_OUT = %w{
166
- # Faraday
151
+ #Faraday
167
152
  URI
168
153
  MonitorMixin
169
154
  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
155
+ +Faraday::Connection#get
156
+ +Faraday::Connection#head
157
+ +Faraday::Connection#delete
158
+ +Faraday::Connection#trace
159
+ +Faraday::Connection#post
160
+ +Faraday::Connection#put
161
+ +Faraday::Connection#patch
177
162
  #multipart-post
178
163
  Multipartable
179
164
  SecureRandom
180
165
  Parts
181
166
  CompositeReadIO
182
- +Multipartable::initialize
167
+ +Multipartable#initialize
183
168
  #rest-client
184
169
  RestClient
185
170
  Netrc
186
171
  HTTP::CookieJar
187
172
  DomainName
188
173
  HTTP::Accept
189
- +RestClient::get
190
- +RestClient::head
191
- +RestClient::delete
192
- +RestClient::trace
193
- +RestClient::post
194
- +RestClient::put
195
- +RestClient::patch
174
+ +RestClient.get
175
+ +RestClient.head
176
+ +RestClient.delete
177
+ +RestClient.trace
178
+ +RestClient.post
179
+ +RestClient.put
180
+ +RestClient.patch
196
181
  #excon
197
182
  Excon
198
- +Excon::get
199
- +Excon::head
200
- +Excon::delete
201
- +Excon::trace
202
- +Excon::post
203
- +Excon::put
204
- +Excon::patch
183
+ +Excon.get
184
+ +Excon.head
185
+ +Excon.delete
186
+ +Excon.trace
187
+ +Excon.post
188
+ +Excon.put
189
+ +Excon.patch
205
190
  #HTTParty
206
191
  HTTParty
207
- +HTTParty::get
208
- +HTTParty::head
209
- +HTTParty::delete
210
- +HTTParty::trace
211
- +HTTParty::post
212
- +HTTParty::put
213
- +HTTParty::patch
192
+ +HTTParty.get
193
+ +HTTParty.head
194
+ +HTTParty.delete
195
+ +HTTParty.trace
196
+ +HTTParty.post
197
+ +HTTParty.put
198
+ +HTTParty.patch
214
199
  #httpclient
215
200
  HTTPClient
216
201
  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
202
+ +HTTPClient#get
203
+ +HTTPClient#head
204
+ +HTTPClient#delete
205
+ +HTTPClient#trace
206
+ +HTTPClient#post
207
+ +HTTPClient#put
208
+ +HTTPClient#patch
209
+ #net-http
210
+ +Net::HTTP.get_response
211
+ +Net::HTTP.get
212
+ +Net::HTTP.head
213
+ +Net::HTTP.delete
214
+ +Net::HTTP.trace
215
+ +Net::HTTP.post
216
+ +Net::HTTP.put
217
+ +Net::HTTP.patch
218
+ +Net::HTTP.post_form
228
219
  }
229
220
 
230
221
  QUERIES = %w{
231
- +Raygun::Apm::Hooks::Redis::process
222
+ #redis
223
+ Redis
224
+ +Redis#auth
225
+ +Redis#select
226
+ +Redis#ping
227
+ +Redis#echo
228
+ +Redis#bgrewriteaof
229
+ +Redis#bgsave
230
+ +Redis#config
231
+ +Redis#dbsize
232
+ +Redis#debug
233
+ +Redis#flushall
234
+ +Redis#flushdb
235
+ +Redis#info
236
+ +Redis#lastsave
237
+ +Redis#monitor
238
+ +Redis#save
239
+ +Redis#shutdown
240
+ +Redis#slave
241
+ +Redis#slowlog
242
+ +Redis#sync
243
+ +Redis#time
244
+ +Redis#persist
245
+ +Redis#expire
246
+ +Redis#expireat
247
+ +Redis#ttl
248
+ +Redis#pexpire
249
+ +Redis#pexpireat
250
+ +Redis#pttl
251
+ +Redis#dump
252
+ +Redis#restore
253
+ +Redis#migrate
254
+ +Redis#del
255
+ +Redis#unlink
256
+ +Redis#exists
257
+ +Redis#keys
258
+ +Redis#move
259
+ +Redis#object
260
+ +Redis#randomkey
261
+ +Redis#rename
262
+ +Redis#renamenx
263
+ +Redis#sort
264
+ +Redis#type
265
+ +Redis#decr
266
+ +Redis#decrby
267
+ +Redis#incr
268
+ +Redis#incrby
269
+ +Redis#incrbyfloat
270
+ +Redis#set
271
+ +Redis#multi
272
+ +Redis#client
273
+ +Redis#set
274
+ +Redis#setex
275
+ +Redis#psetex
276
+ +Redis#setnx
277
+ +Redis#mset
278
+ +Redis#mapped_mset
279
+ +Redis#msetnx
280
+ +Redis#mapped_msetnx
281
+ +Redis#get
282
+ +Redis#mget
283
+ +Redis#mapped_mget
284
+ +Redis#setrange
285
+ +Redis#getrange
286
+ +Redis#setbit
287
+ +Redis#getbit
288
+ +Redis#append
289
+ +Redis#bitcount
290
+ +Redis#bitop
291
+ +Redis#bitpos
292
+ +Redis#getset
293
+ +Redis#strlen
294
+ +Redis#llen
295
+ +Redis#lpush
296
+ +Redis#lpushx
297
+ +Redis#rpush
298
+ +Redis#rpushx
299
+ +Redis#lpop
300
+ +Redis#rpop
301
+ +Redis#rpoplpush
302
+ +Redis#blpop
303
+ +Redis#brpop
304
+ +Redis#brpoplpush
305
+ +Redis#lindex
306
+ +Redis#linsert
307
+ +Redis#lrange
308
+ +Redis#lrem
309
+ +Redis#lset
310
+ +Redis#ltrim
311
+ +Redis#scard
312
+ +Redis#sadd
313
+ +Redis#srem
314
+ +Redis#spop
315
+ +Redis#srandmember
316
+ +Redis#smove
317
+ +Redis#sismember
318
+ +Redis#smembers
319
+ +Redis#sdiff
320
+ +Redis#sdiffstore
321
+ +Redis#sinter
322
+ +Redis#sinterstore
323
+ +Redis#sunion
324
+ +Redis#sunionstore
325
+ +Redis#zcard
326
+ +Redis#zadd
327
+ +Redis#zincrby
328
+ +Redis#zrem
329
+ +Redis#zpopmax
330
+ +Redis#zpopmin
331
+ +Redis#bzpopmax
332
+ +Redis#bzpopmin
333
+ +Redis#zscore
334
+ +Redis#zrange
335
+ +Redis#zrevrange
336
+ +Redis#zrank
337
+ +Redis#zrevrank
338
+ +Redis#zremrangebyrank
339
+ +Redis#zlexcount
340
+ +Redis#zrangebylex
341
+ +Redis#zrevrangebylex
342
+ +Redis#zrangebyscore
343
+ +Redis#zrevrangebyscore
344
+ +Redis#zremrangebyscore
345
+ +Redis#zcount
346
+ +Redis#zinterstore
347
+ +Redis#zunionstore
348
+ +Redis#hlen
349
+ +Redis#hset
350
+ +Redis#hsetnx
351
+ +Redis#hmset
352
+ +Redis#mapped_hmset
353
+ +Redis#hget
354
+ +Redis#hmget
355
+ +Redis#mapped_hmget
356
+ +Redis#hdel
357
+ +Redis#hexists
358
+ +Redis#hincrby
359
+ +Redis#hincrbyfloat
360
+ +Redis#hkeys
361
+ +Redis#hvals
362
+ +Redis#hgetall
363
+ +Redis#publish
364
+ +Redis#subscribe
365
+ +Redis#subscribe_with_timeout
366
+ +Redis#unsubscribe
367
+ +Redis#psubscribe
368
+ +Redis#psubscribe_with_timeout
369
+ +Redis#punsubscribe
370
+ +Redis#pubsub
371
+ +Redis#watch
372
+ +Redis#unwatch
373
+ +Redis#pipelined
374
+ +Redis#multi
375
+ +Redis#exec
376
+ +Redis#discard
377
+ +Redis#script
378
+ +Redis#eval
379
+ +Redis#evalsha
380
+ +Redis#scan
381
+ +Redis#hscan
382
+ +Redis#zscan
383
+ +Redis#sscan
384
+ +Redis#pfadd
385
+ +Redis#pfcount
386
+ +Redis#pfmerge
387
+ +Redis#geoadd
388
+ +Redis#geohash
389
+ +Redis#georadiusbymember
390
+ +Redis#geopos
391
+ +Redis#geodist
392
+ +Redis#xinfo
393
+ +Redis#xadd
394
+ +Redis#xtrim
395
+ +Redis#xdel
396
+ +Redis#xrange
397
+ +Redis#xrevrange
398
+ +Redis#xlen
399
+ +Redis#xread
400
+ +Redis#xgroup
401
+ +Redis#xreadgroup
402
+ +Redis#xack
403
+ +Redis#xclaim
404
+ +Redis#xpending
405
+ +Redis#sentinel
406
+ +Redis#cluster
407
+ +Redis#asking
408
+ }
409
+
410
+ RAYGUN4RUBY = %w{
411
+ Raygun::Breadcrumbs
412
+ Raygun::Configuration
413
+ Raygun.config
414
+ Raygun.log
415
+ Raygun.should_report?
416
+ Raygun::Client
417
+ +Raygun.track_exception
232
418
  }
233
419
 
234
420
  def self.extend_with(list)
@@ -240,7 +426,7 @@ module Raygun
240
426
  end
241
427
 
242
428
  def self.resolve_entries
243
- DEFAULT_RUBY + PROFILER + HTTP_OUT + QUERIES + self.extended_blacklist.flatten
429
+ DEFAULT_RUBY + PROFILER + HTTP_OUT + QUERIES + RAYGUN4RUBY + self.extended_blacklist.flatten
244
430
  end
245
431
  end
246
432
  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
@@ -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
@@ -6,7 +6,7 @@ module Raygun
6
6
  end
7
7
  class ThreadStarted < Event
8
8
  def inspect
9
- super + " "
9
+ super + " parent_tid:#{self[:parent_tid]}"
10
10
  end
11
11
  end
12
12
  class Begin < Event
@@ -18,42 +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']
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
@@ -1,5 +1,5 @@
1
1
  module Raygun
2
2
  module Apm
3
- VERSION = "1.0.41"
3
+ VERSION = "1.0.46"
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.41
4
+ version: 1.0.46
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-05-29 00:00:00.000000000 Z
12
+ date: 2020-06-27 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