raygun-apm 1.1.14-x86_64-linux → 1.1.15.pre2-x86_64-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 +4 -4
- data/COPYING.rax +9 -9
- data/LICENSE +27 -27
- data/LICENSE.bipbuffer +24 -24
- data/README.rdoc +118 -118
- data/bin/console +14 -14
- data/bin/raygun-diagnostics +6 -6
- data/bin/setup +8 -8
- data/ext/raygun/extconf.rb +59 -58
- 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/3.0/raygun_ext.so +0 -0
- data/lib/raygun/3.1/raygun_ext.so +0 -0
- data/lib/raygun/apm/blacklist/parser.rb +49 -49
- data/lib/raygun/apm/blacklist/translator.rb +78 -78
- data/lib/raygun/apm/blacklist.rb +476 -476
- data/lib/raygun/apm/config.rb +106 -106
- data/lib/raygun/apm/diagnostics.rb +54 -54
- data/lib/raygun/apm/event.rb +48 -48
- data/lib/raygun/apm/hooks/excon.rb +36 -36
- data/lib/raygun/apm/hooks/httpclient.rb +43 -43
- data/lib/raygun/apm/hooks/internals.rb +95 -95
- data/lib/raygun/apm/hooks/mongodb.rb +45 -45
- data/lib/raygun/apm/hooks/net_http.rb +44 -44
- data/lib/raygun/apm/hooks/redis.rb +46 -46
- data/lib/raygun/apm/tracer.rb +131 -131
- data/lib/raygun/apm/version.rb +6 -6
- data/lib/raygun/apm.rb +18 -18
- data/lib/raygun/raygun_ext.so +0 -0
- data/raygun-apm.gemspec +40 -40
- metadata +4 -4
data/lib/raygun/apm/tracer.rb
CHANGED
@@ -1,131 +1,131 @@
|
|
1
|
-
require 'raygun/apm/blacklist'
|
2
|
-
require 'rbconfig'
|
3
|
-
|
4
|
-
module Raygun
|
5
|
-
module Apm
|
6
|
-
class Tracer
|
7
|
-
@__mutex = Mutex.new
|
8
|
-
|
9
|
-
@__pids ||= {}
|
10
|
-
class << self
|
11
|
-
def synchronize(&block)
|
12
|
-
@__mutex.synchronize { block.call }
|
13
|
-
end
|
14
|
-
|
15
|
-
def instance
|
16
|
-
@__pids[Process.pid]
|
17
|
-
end
|
18
|
-
|
19
|
-
def instance=(tracer)
|
20
|
-
@__pids[Process.pid] = tracer
|
21
|
-
end
|
22
|
-
|
23
|
-
def patch(concern, hook)
|
24
|
-
concern.prepend(hook) unless concern.ancestors.include?(hook)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
attr_accessor :config
|
29
|
-
|
30
|
-
def initialize(env=ENV)
|
31
|
-
configure(env)
|
32
|
-
initialize_blacklist
|
33
|
-
register_known_library_paths
|
34
|
-
run_agent_connectivity_diagnostics
|
35
|
-
require_hooks
|
36
|
-
ObjectSpace.define_finalizer(self, proc{ disable_tracepoints })
|
37
|
-
# Any fails here is kamikaze for the tracer
|
38
|
-
rescue => e
|
39
|
-
# 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} #{e.backtrace.join("\n")}"
|
41
|
-
end
|
42
|
-
|
43
|
-
def udp_sink!
|
44
|
-
sock = UDPSocket.new
|
45
|
-
# For UDP sockets, SO_SNDBUF is the max packet size and NOT send buffer as with a connection oriented transport
|
46
|
-
sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_SNDBUF, Tracer::BATCH_PACKET_SIZE)
|
47
|
-
self.udp_sink(
|
48
|
-
socket: sock,
|
49
|
-
host: config.proton_udp_host,
|
50
|
-
port: config.proton_udp_port,
|
51
|
-
receive_buffer_size: sock.getsockopt(Socket::SOL_SOCKET, Socket::SO_RCVBUF).int
|
52
|
-
)
|
53
|
-
rescue => e
|
54
|
-
# XXX works for the middleware wrapped case, not for standalone - revisit
|
55
|
-
raise Raygun::Apm::FatalError, "Raygun APM UDP sink could not be initialized: #{e.message} #{e.backtrace.join("\n")}"
|
56
|
-
end
|
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
|
-
|
76
|
-
private
|
77
|
-
def configure(env)
|
78
|
-
@config = Config.new(env)
|
79
|
-
# Special assignments from config to the Tracer
|
80
|
-
self.log_level = config.loglevel
|
81
|
-
self.environment = config.environment
|
82
|
-
self.api_key = config.proton_api_key
|
83
|
-
end
|
84
|
-
|
85
|
-
def initialize_blacklist
|
86
|
-
@blacklist_parser = Raygun::Apm::Blacklist::Parser.new(self)
|
87
|
-
file = @config.blacklist_file
|
88
|
-
@blacklist = if file && File.exist?(file)
|
89
|
-
File.readlines(file)
|
90
|
-
else
|
91
|
-
[]
|
92
|
-
end
|
93
|
-
# Defaults
|
94
|
-
@blacklist_parser.add_filters Raygun::Apm::Blacklist.resolve_entries
|
95
|
-
# From file
|
96
|
-
@blacklist_parser.add_filters @blacklist
|
97
|
-
end
|
98
|
-
|
99
|
-
def register_known_library_paths
|
100
|
-
if defined?(Bundler)
|
101
|
-
libs = Bundler.load.specs.map(&:full_gem_path).sort << RbConfig::CONFIG['rubylibdir']
|
102
|
-
libs.delete(Dir.getwd)
|
103
|
-
self.register_libraries libs
|
104
|
-
else
|
105
|
-
self.register_libraries [RbConfig::CONFIG['rubylibdir']]
|
106
|
-
end
|
107
|
-
end
|
108
|
-
|
109
|
-
def run_agent_connectivity_diagnostics
|
110
|
-
check = Raygun::Apm::Diagnostics.new
|
111
|
-
check.verify_agent(self)
|
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
|
129
|
-
end
|
130
|
-
end
|
131
|
-
end
|
1
|
+
require 'raygun/apm/blacklist'
|
2
|
+
require 'rbconfig'
|
3
|
+
|
4
|
+
module Raygun
|
5
|
+
module Apm
|
6
|
+
class Tracer
|
7
|
+
@__mutex = Mutex.new
|
8
|
+
|
9
|
+
@__pids ||= {}
|
10
|
+
class << self
|
11
|
+
def synchronize(&block)
|
12
|
+
@__mutex.synchronize { block.call }
|
13
|
+
end
|
14
|
+
|
15
|
+
def instance
|
16
|
+
@__pids[Process.pid]
|
17
|
+
end
|
18
|
+
|
19
|
+
def instance=(tracer)
|
20
|
+
@__pids[Process.pid] = tracer
|
21
|
+
end
|
22
|
+
|
23
|
+
def patch(concern, hook)
|
24
|
+
concern.prepend(hook) unless concern.ancestors.include?(hook)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
attr_accessor :config
|
29
|
+
|
30
|
+
def initialize(env=ENV)
|
31
|
+
configure(env)
|
32
|
+
initialize_blacklist
|
33
|
+
register_known_library_paths
|
34
|
+
run_agent_connectivity_diagnostics
|
35
|
+
require_hooks
|
36
|
+
ObjectSpace.define_finalizer(self, proc{ disable_tracepoints })
|
37
|
+
# Any fails here is kamikaze for the tracer
|
38
|
+
rescue => e
|
39
|
+
# 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} #{e.backtrace.join("\n")}"
|
41
|
+
end
|
42
|
+
|
43
|
+
def udp_sink!
|
44
|
+
sock = UDPSocket.new
|
45
|
+
# For UDP sockets, SO_SNDBUF is the max packet size and NOT send buffer as with a connection oriented transport
|
46
|
+
sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_SNDBUF, Tracer::BATCH_PACKET_SIZE)
|
47
|
+
self.udp_sink(
|
48
|
+
socket: sock,
|
49
|
+
host: config.proton_udp_host,
|
50
|
+
port: config.proton_udp_port,
|
51
|
+
receive_buffer_size: sock.getsockopt(Socket::SOL_SOCKET, Socket::SO_RCVBUF).int
|
52
|
+
)
|
53
|
+
rescue => e
|
54
|
+
# XXX works for the middleware wrapped case, not for standalone - revisit
|
55
|
+
raise Raygun::Apm::FatalError, "Raygun APM UDP sink could not be initialized: #{e.message} #{e.backtrace.join("\n")}"
|
56
|
+
end
|
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
|
+
|
76
|
+
private
|
77
|
+
def configure(env)
|
78
|
+
@config = Config.new(env)
|
79
|
+
# Special assignments from config to the Tracer
|
80
|
+
self.log_level = config.loglevel
|
81
|
+
self.environment = config.environment
|
82
|
+
self.api_key = config.proton_api_key
|
83
|
+
end
|
84
|
+
|
85
|
+
def initialize_blacklist
|
86
|
+
@blacklist_parser = Raygun::Apm::Blacklist::Parser.new(self)
|
87
|
+
file = @config.blacklist_file
|
88
|
+
@blacklist = if file && File.exist?(file)
|
89
|
+
File.readlines(file)
|
90
|
+
else
|
91
|
+
[]
|
92
|
+
end
|
93
|
+
# Defaults
|
94
|
+
@blacklist_parser.add_filters Raygun::Apm::Blacklist.resolve_entries
|
95
|
+
# From file
|
96
|
+
@blacklist_parser.add_filters @blacklist
|
97
|
+
end
|
98
|
+
|
99
|
+
def register_known_library_paths
|
100
|
+
if defined?(Bundler)
|
101
|
+
libs = Bundler.load.specs.map(&:full_gem_path).sort << RbConfig::CONFIG['rubylibdir']
|
102
|
+
libs.delete(Dir.getwd)
|
103
|
+
self.register_libraries libs
|
104
|
+
else
|
105
|
+
self.register_libraries [RbConfig::CONFIG['rubylibdir']]
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
def run_agent_connectivity_diagnostics
|
110
|
+
check = Raygun::Apm::Diagnostics.new
|
111
|
+
check.verify_agent(self)
|
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
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
data/lib/raygun/apm/version.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
module Raygun
|
2
|
-
module Apm
|
3
|
-
VERSION = "1.1.
|
4
|
-
MINIMUM_AGENT_VERSION = "1.0.1190.0"
|
5
|
-
end
|
6
|
-
end
|
1
|
+
module Raygun
|
2
|
+
module Apm
|
3
|
+
VERSION = "1.1.15.pre2"
|
4
|
+
MINIMUM_AGENT_VERSION = "1.0.1190.0"
|
5
|
+
end
|
6
|
+
end
|
data/lib/raygun/apm.rb
CHANGED
@@ -1,18 +1,18 @@
|
|
1
|
-
require "raygun/apm/version"
|
2
|
-
require "socket"
|
3
|
-
|
4
|
-
begin
|
5
|
-
# Attempt to load a precompiled shared object (released gem)
|
6
|
-
RUBY_VERSION =~ /(\d+\.\d+)/
|
7
|
-
require "raygun/#{$1}/raygun_ext"
|
8
|
-
rescue LoadError
|
9
|
-
# Attempt to load the development specific extension (non-released gem, local dev)
|
10
|
-
require "raygun/raygun_ext"
|
11
|
-
end
|
12
|
-
|
13
|
-
require "raygun/apm/config"
|
14
|
-
require "raygun/apm/diagnostics"
|
15
|
-
require "raygun/apm/blacklist/parser"
|
16
|
-
require "raygun/apm/blacklist/translator"
|
17
|
-
require "raygun/apm/tracer"
|
18
|
-
require "raygun/apm/event"
|
1
|
+
require "raygun/apm/version"
|
2
|
+
require "socket"
|
3
|
+
|
4
|
+
begin
|
5
|
+
# Attempt to load a precompiled shared object (released gem)
|
6
|
+
RUBY_VERSION =~ /(\d+\.\d+)/
|
7
|
+
require "raygun/#{$1}/raygun_ext"
|
8
|
+
rescue LoadError
|
9
|
+
# Attempt to load the development specific extension (non-released gem, local dev)
|
10
|
+
require "raygun/raygun_ext"
|
11
|
+
end
|
12
|
+
|
13
|
+
require "raygun/apm/config"
|
14
|
+
require "raygun/apm/diagnostics"
|
15
|
+
require "raygun/apm/blacklist/parser"
|
16
|
+
require "raygun/apm/blacklist/translator"
|
17
|
+
require "raygun/apm/tracer"
|
18
|
+
require "raygun/apm/event"
|
data/lib/raygun/raygun_ext.so
CHANGED
Binary file
|
data/raygun-apm.gemspec
CHANGED
@@ -1,40 +1,40 @@
|
|
1
|
-
|
2
|
-
require File.expand_path('../lib/raygun/apm/version', __FILE__)
|
3
|
-
|
4
|
-
Gem::Specification.new do |spec|
|
5
|
-
spec.name = "raygun-apm"
|
6
|
-
spec.version = Raygun::Apm::VERSION
|
7
|
-
|
8
|
-
spec.authors = ["Raygun Limited"]
|
9
|
-
spec.email = ["ruby-apm@raygun.io", "support@raygun.com"]
|
10
|
-
|
11
|
-
spec.summary = %q{Raygun application performance monitoring core Profiler}
|
12
|
-
spec.homepage = "https://raygun.com/platform/apm"
|
13
|
-
spec.license = "MIT"
|
14
|
-
|
15
|
-
spec.files = Dir['README.rdoc', 'raygun-apm.gemspec', 'LICENSE', 'LICENSE.bipbuffer', 'COPYING.rax', 'lib/**/*', 'bin/**/*'].reject { |f| f.match(/raygun_ext\./) }
|
16
|
-
spec.files += Dir['lib/raygun/**/{2}*/raygun_ext.*']
|
17
|
-
spec.bindir = "bin"
|
18
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
|
-
spec.require_paths = ["lib", "ext"]
|
20
|
-
|
21
|
-
spec.platform = Gem::Platform::RUBY
|
22
|
-
|
23
|
-
spec.extensions = ["ext/raygun/extconf.rb"]
|
24
|
-
spec.required_ruby_version = '>= 2.5.0'
|
25
|
-
|
26
|
-
spec.add_development_dependency "debase-ruby_core_source", "~> 0.10.14"
|
27
|
-
spec.add_development_dependency "bundler", "~> 2.2.15"
|
28
|
-
spec.add_development_dependency "rake", "~> 13.0.3"
|
29
|
-
spec.add_development_dependency "minitest", "~> 5.14.4"
|
30
|
-
spec.add_development_dependency "rake-compiler", "~> 1.1.1"
|
31
|
-
spec.add_development_dependency "rake-compiler-dock", "~> 1.2.1"
|
32
|
-
spec.add_development_dependency "benchmark_driver", "~> 0.15.9"
|
33
|
-
spec.add_development_dependency "faraday", "~> 1.0.1"
|
34
|
-
spec.add_development_dependency "multipart-post", "~> 2.1.1"
|
35
|
-
spec.add_development_dependency "rest-client", "~> 2.1.0"
|
36
|
-
spec.add_development_dependency "excon", "~> 0.73.0"
|
37
|
-
spec.add_development_dependency "httparty", "~> 0.18.0"
|
38
|
-
spec.add_development_dependency "httpclient", "~> 2.8.3"
|
39
|
-
spec.add_development_dependency "mongoid", "~> 7.1.2"
|
40
|
-
end
|
1
|
+
|
2
|
+
require File.expand_path('../lib/raygun/apm/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |spec|
|
5
|
+
spec.name = "raygun-apm"
|
6
|
+
spec.version = Raygun::Apm::VERSION
|
7
|
+
|
8
|
+
spec.authors = ["Raygun Limited"]
|
9
|
+
spec.email = ["ruby-apm@raygun.io", "support@raygun.com"]
|
10
|
+
|
11
|
+
spec.summary = %q{Raygun application performance monitoring core Profiler}
|
12
|
+
spec.homepage = "https://raygun.com/platform/apm"
|
13
|
+
spec.license = "MIT"
|
14
|
+
|
15
|
+
spec.files = Dir['README.rdoc', 'raygun-apm.gemspec', 'LICENSE', 'LICENSE.bipbuffer', 'COPYING.rax', 'lib/**/*', 'bin/**/*'].reject { |f| f.match(/raygun_ext\./) }
|
16
|
+
spec.files += Dir['lib/raygun/**/{2}*/raygun_ext.*']
|
17
|
+
spec.bindir = "bin"
|
18
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
|
+
spec.require_paths = ["lib", "ext"]
|
20
|
+
|
21
|
+
spec.platform = Gem::Platform::RUBY
|
22
|
+
|
23
|
+
spec.extensions = ["ext/raygun/extconf.rb"]
|
24
|
+
spec.required_ruby_version = '>= 2.5.0'
|
25
|
+
|
26
|
+
spec.add_development_dependency "debase-ruby_core_source", "~> 0.10.14"
|
27
|
+
spec.add_development_dependency "bundler", "~> 2.2.15"
|
28
|
+
spec.add_development_dependency "rake", "~> 13.0.3"
|
29
|
+
spec.add_development_dependency "minitest", "~> 5.14.4"
|
30
|
+
spec.add_development_dependency "rake-compiler", "~> 1.1.1"
|
31
|
+
spec.add_development_dependency "rake-compiler-dock", "~> 1.2.1"
|
32
|
+
spec.add_development_dependency "benchmark_driver", "~> 0.15.9"
|
33
|
+
spec.add_development_dependency "faraday", "~> 1.0.1"
|
34
|
+
spec.add_development_dependency "multipart-post", "~> 2.1.1"
|
35
|
+
spec.add_development_dependency "rest-client", "~> 2.1.0"
|
36
|
+
spec.add_development_dependency "excon", "~> 0.73.0"
|
37
|
+
spec.add_development_dependency "httparty", "~> 0.18.0"
|
38
|
+
spec.add_development_dependency "httpclient", "~> 2.8.3"
|
39
|
+
spec.add_development_dependency "mongoid", "~> 7.1.2"
|
40
|
+
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.15.pre2
|
5
5
|
platform: x86_64-linux
|
6
6
|
authors:
|
7
7
|
- Raygun Limited
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: debase-ruby_core_source
|
@@ -263,9 +263,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
263
263
|
version: 3.2.dev
|
264
264
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
265
265
|
requirements:
|
266
|
-
- - "
|
266
|
+
- - ">"
|
267
267
|
- !ruby/object:Gem::Version
|
268
|
-
version:
|
268
|
+
version: 1.3.1
|
269
269
|
requirements: []
|
270
270
|
rubygems_version: 3.3.4
|
271
271
|
signing_key:
|