raygun-apm 1.1.7-universal-darwin → 1.1.11-universal-darwin
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- 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/3.0/raygun_ext.bundle +0 -0
- data/lib/raygun/apm/config.rb +11 -2
- data/lib/raygun/apm/hooks/excon.rb +1 -1
- data/lib/raygun/apm/hooks/httpclient.rb +1 -1
- data/lib/raygun/apm/hooks/internals.rb +5 -5
- data/lib/raygun/apm/hooks/mongodb.rb +1 -1
- data/lib/raygun/apm/hooks/net_http.rb +1 -1
- data/lib/raygun/apm/hooks/redis.rb +1 -1
- data/lib/raygun/apm/tracer.rb +45 -2
- data/lib/raygun/apm/version.rb +1 -1
- data/lib/raygun/apm.rb +1 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: baf629d9ee033c6ea1ef9828274a2e4ca14f90cdfbbf9a5d7b7c189368298ea7
|
4
|
+
data.tar.gz: f5f2c325f04ba68735a632fc512e6156be2a9037a699ce264f9ab59ee6fdb742
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b38a703a2050546705655b9ec734ac832cba69bd646aac3df0595ad3c16fcce24c5275aa4a96d93409bf78290872b943cb5a3425f4b1ac89ff0fdfa8b03f2134
|
7
|
+
data.tar.gz: 57032094b9643733c4e12196b0727fc146d2ee094c4ae09db10bc6008555f90380ffae24193345b0464a8ebe11167ce12ce5423ba8eb515dc2f3190abd27e4ad
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/lib/raygun/apm/config.rb
CHANGED
@@ -52,9 +52,9 @@ module Raygun
|
|
52
52
|
end
|
53
53
|
|
54
54
|
# Initial constants for ProtonAgentTail.exe
|
55
|
-
UDP_SINK_HOST = TCP_MANAGEMENT_HOST = '127.0.0.1'
|
55
|
+
UDP_SINK_HOST = TCP_SINK_HOST = TCP_MANAGEMENT_HOST = '127.0.0.1'
|
56
56
|
UDP_SINK_MULTICAST_HOST = '239.100.15.215'
|
57
|
-
UDP_SINK_PORT = 2799
|
57
|
+
UDP_SINK_PORT = TCP_SINK_PORT = 2799
|
58
58
|
TCP_MANAGEMENT_PORT = 2790
|
59
59
|
|
60
60
|
## Enumerate all PROTON_ constants
|
@@ -68,6 +68,11 @@ module Raygun
|
|
68
68
|
## New - Ruby profiler
|
69
69
|
config_var 'PROTON_UDP_HOST', as: String, default: UDP_SINK_HOST
|
70
70
|
config_var 'PROTON_UDP_PORT', as: Integer, default: UDP_SINK_PORT
|
71
|
+
config_var 'PROTON_TCP_HOST', as: String, default: TCP_SINK_HOST
|
72
|
+
config_var 'PROTON_TCP_PORT', as: Integer, default: TCP_SINK_PORT
|
73
|
+
## Conditional hooks
|
74
|
+
config_var 'PROTON_HOOK_REDIS', as: :boolean, default: 'True'
|
75
|
+
config_var 'PROTON_HOOK_INTERNALS', as: :boolean, default: 'True'
|
71
76
|
|
72
77
|
def proton_udp_host
|
73
78
|
if proton_use_multicast == 'True'
|
@@ -77,6 +82,10 @@ module Raygun
|
|
77
82
|
end
|
78
83
|
end
|
79
84
|
|
85
|
+
def proton_tcp_host
|
86
|
+
env['PROTON_TCP_HOST'] ? env['PROTON_TCP_HOST'].to_s : TCP_SINK_HOST
|
87
|
+
end
|
88
|
+
|
80
89
|
def loglevel
|
81
90
|
LOGLEVELS[proton_debug_loglevel] || raise(ArgumentError, "invalid log level")
|
82
91
|
end
|
@@ -88,8 +88,8 @@ module Raygun
|
|
88
88
|
end
|
89
89
|
end
|
90
90
|
|
91
|
-
Object
|
92
|
-
IO
|
93
|
-
Random
|
94
|
-
Signal
|
95
|
-
Thread::Mutex
|
91
|
+
Raygun::Apm::Tracer.patch(Object, Raygun::Apm::Hooks::Object)
|
92
|
+
Raygun::Apm::Tracer.patch(IO, Raygun::Apm::Hooks::IO)
|
93
|
+
Raygun::Apm::Tracer.patch(Random, Raygun::Apm::Hooks::Random)
|
94
|
+
Raygun::Apm::Tracer.patch(Signal, Raygun::Apm::Hooks::Signal)
|
95
|
+
Raygun::Apm::Tracer.patch(Thread::Mutex, Raygun::Apm::Hooks::Mutex)
|
@@ -41,5 +41,5 @@ module Raygun
|
|
41
41
|
end
|
42
42
|
|
43
43
|
Mongo::Operation.constants.each do |operation|
|
44
|
-
Mongo::Operation.const_get(operation)
|
44
|
+
Raygun::Apm::Tracer.patch(Mongo::Operation.const_get(operation), Raygun::Apm::Hooks::MongoDB) rescue nil
|
45
45
|
end
|
data/lib/raygun/apm/tracer.rb
CHANGED
@@ -4,8 +4,14 @@ require 'rbconfig'
|
|
4
4
|
module Raygun
|
5
5
|
module Apm
|
6
6
|
class Tracer
|
7
|
+
@__mutex = Mutex.new
|
8
|
+
|
7
9
|
@__pids ||= {}
|
8
10
|
class << self
|
11
|
+
def synchronize(&block)
|
12
|
+
@__mutex.synchronize { block.call }
|
13
|
+
end
|
14
|
+
|
9
15
|
def instance
|
10
16
|
@__pids[Process.pid]
|
11
17
|
end
|
@@ -13,6 +19,10 @@ module Raygun
|
|
13
19
|
def instance=(tracer)
|
14
20
|
@__pids[Process.pid] = tracer
|
15
21
|
end
|
22
|
+
|
23
|
+
def patch(concern, hook)
|
24
|
+
concern.prepend(hook) unless concern.ancestors.include?(hook)
|
25
|
+
end
|
16
26
|
end
|
17
27
|
|
18
28
|
attr_accessor :config
|
@@ -22,6 +32,7 @@ module Raygun
|
|
22
32
|
initialize_blacklist
|
23
33
|
register_known_library_paths
|
24
34
|
run_agent_connectivity_diagnostics
|
35
|
+
require_hooks
|
25
36
|
ObjectSpace.define_finalizer(self, proc{ disable_tracepoints })
|
26
37
|
# Any fails here is kamikaze for the tracer
|
27
38
|
rescue => e
|
@@ -30,7 +41,6 @@ module Raygun
|
|
30
41
|
end
|
31
42
|
|
32
43
|
def udp_sink!
|
33
|
-
require "socket"
|
34
44
|
sock = UDPSocket.new
|
35
45
|
# For UDP sockets, SO_SNDBUF is the max packet size and NOT send buffer as with a connection oriented transport
|
36
46
|
sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_SNDBUF, Tracer::BATCH_PACKET_SIZE)
|
@@ -40,12 +50,29 @@ module Raygun
|
|
40
50
|
port: config.proton_udp_port,
|
41
51
|
receive_buffer_size: sock.getsockopt(Socket::SOL_SOCKET, Socket::SO_RCVBUF).int
|
42
52
|
)
|
43
|
-
# Any fails here is kamikaze for the tracer
|
44
53
|
rescue => e
|
45
54
|
# XXX works for the middleware wrapped case, not for standalone - revisit
|
46
55
|
raise Raygun::Apm::FatalError, "Raygun APM UDP sink could not be initialized: #{e.message} #{e.backtrace.join("\n")}"
|
47
56
|
end
|
48
57
|
|
58
|
+
def tcp_sink!
|
59
|
+
self.tcp_sink(
|
60
|
+
host: config.proton_tcp_host,
|
61
|
+
port: config.proton_tcp_port
|
62
|
+
)
|
63
|
+
rescue => e
|
64
|
+
# XXX works for the middleware wrapped case, not for standalone - revisit
|
65
|
+
raise Raygun::Apm::FatalError, "Raygun APM TCP sink could not be initialized: #{e.message} #{e.backtrace.join("\n")}"
|
66
|
+
end
|
67
|
+
|
68
|
+
def enable_sink!
|
69
|
+
if config.proton_network_mode == "Udp"
|
70
|
+
udp_sink!
|
71
|
+
elsif config.proton_network_mode == "Tcp"
|
72
|
+
tcp_sink!
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
49
76
|
private
|
50
77
|
def configure(env)
|
51
78
|
@config = Config.new(env)
|
@@ -83,6 +110,22 @@ module Raygun
|
|
83
110
|
check = Raygun::Apm::Diagnostics.new
|
84
111
|
check.verify_agent(self)
|
85
112
|
end
|
113
|
+
|
114
|
+
def require_hooks
|
115
|
+
require "raygun/apm/hooks/internals" if @config.proton_hook_internals
|
116
|
+
require "raygun/apm/hooks/net_http"
|
117
|
+
# conditionally required - may not be bundled
|
118
|
+
conditional_hooks = %w(httpclient excon mongodb)
|
119
|
+
conditional_hooks.each do |hook|
|
120
|
+
begin
|
121
|
+
require "raygun/apm/hooks/#{hook}"
|
122
|
+
rescue LoadError
|
123
|
+
end
|
124
|
+
end
|
125
|
+
if @config.proton_hook_redis
|
126
|
+
require "raygun/apm/hooks/redis" if defined?(Redis::Client)
|
127
|
+
end
|
128
|
+
end
|
86
129
|
end
|
87
130
|
end
|
88
131
|
end
|
data/lib/raygun/apm/version.rb
CHANGED
data/lib/raygun/apm.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "raygun/apm/version"
|
2
|
+
require "socket"
|
2
3
|
|
3
4
|
begin
|
4
5
|
# Attempt to load a precompiled shared object (released gem)
|
@@ -15,13 +16,3 @@ require "raygun/apm/blacklist/parser"
|
|
15
16
|
require "raygun/apm/blacklist/translator"
|
16
17
|
require "raygun/apm/tracer"
|
17
18
|
require "raygun/apm/event"
|
18
|
-
require "raygun/apm/hooks/internals"
|
19
|
-
require "raygun/apm/hooks/net_http"
|
20
|
-
# conditionally required - may not be bundled
|
21
|
-
conditional_hooks = %w(httpclient excon mongodb)
|
22
|
-
conditional_hooks.each do |hook|
|
23
|
-
begin
|
24
|
-
require "raygun/apm/hooks/#{hook}"
|
25
|
-
rescue LoadError
|
26
|
-
end
|
27
|
-
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: raygun-apm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.11
|
5
5
|
platform: universal-darwin
|
6
6
|
authors:
|
7
7
|
- Raygun Limited
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: debase-ruby_core_source
|