raygun-apm 1.0.65-x86-mingw32 → 1.0.73-x86-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 → raygun-diagnostics} +1 -2
- data/ext/raygun/extconf.rb +7 -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 +6 -4
- data/lib/raygun/apm/blacklist.rb +6 -0
- data/lib/raygun/apm/config.rb +15 -6
- data/lib/raygun/apm/diagnostics.rb +1 -1
- data/lib/raygun/apm/event.rb +10 -0
- data/lib/raygun/apm/hooks/mongodb.rb +45 -0
- data/lib/raygun/apm/tracer.rb +10 -7
- data/lib/raygun/apm/version.rb +1 -1
- data/raygun-apm.gemspec +2 -1
- metadata +19 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71e2d39e7afe4f5683654d18305de7bde223b4f2aaa13e2f63c84e9004ecd5bb
|
4
|
+
data.tar.gz: d0e7069a5d95476628ddc74c619d02e3b94c74727c3496b5b932bdfb38f21b89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 879701fc83c289aa8b1452b3a8578d56eb1beaf79da0cabc025369a4c2267257a661438807d396eb8fab2539271a6ca1e52ec65c15c53c4da52485eb151318af
|
7
|
+
data.tar.gz: 3d0d992293c9df6ed8534115e2ae8ef667aa34a9b3822fc53895e0cce8e04625dc79a249befada202e3b3189cccdd7667ff745a2b54ab149d3ea4b14bfa48be6
|
data/ext/raygun/extconf.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
+
# Makefile generator helper - from standard library
|
3
4
|
require 'mkmf'
|
5
|
+
# References core headers extracted by Ruby minor version in https://github.com/os97673/debase-ruby_core_source . Required for some of the lower level profiler features
|
4
6
|
require 'debase/ruby_core_source'
|
5
7
|
|
6
8
|
headers = proc do
|
@@ -11,12 +13,15 @@ end
|
|
11
13
|
|
12
14
|
dir_config('raygun')
|
13
15
|
|
16
|
+
# To allow for swapping out the compiler - clang in favour of gcc for example
|
14
17
|
RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
|
15
18
|
|
19
|
+
# Pendatic about all the things
|
16
20
|
append_cflags '-pedantic'
|
17
21
|
append_cflags '-Wall'
|
18
22
|
append_cflags '-Werror=switch'
|
19
23
|
append_cflags '-std=c99'
|
24
|
+
# Enables additional flags, stack protection and debug symbols
|
20
25
|
if ENV['DEBUG']
|
21
26
|
have_library 'ssp'
|
22
27
|
have_func '__stack_chk_guard'
|
@@ -33,6 +38,7 @@ else
|
|
33
38
|
append_cflags '-O3'
|
34
39
|
end
|
35
40
|
|
41
|
+
# Renders an ASCII presentation of the shadow stack at runtime
|
36
42
|
if ENV['DEBUG_SHADOW_STACK']
|
37
43
|
append_cflags '-DRB_RG_DEBUG_SHADOW_STACK'
|
38
44
|
end
|
@@ -42,6 +48,7 @@ unless create_header
|
|
42
48
|
exit(1)
|
43
49
|
end
|
44
50
|
|
51
|
+
# Check for the presence of headers in ruby_core_headers for the version currently compiled for
|
45
52
|
unless Debase::RubyCoreSource.create_makefile_with_core(headers, 'raygun_ext')
|
46
53
|
STDERR.print("Makefile creation failed\n")
|
47
54
|
STDERR.print("One or more ruby headers not found\n")
|
Binary file
|
Binary file
|
Binary file
|
data/lib/raygun/apm.rb
CHANGED
@@ -18,8 +18,10 @@ require "raygun/apm/event"
|
|
18
18
|
require "raygun/apm/hooks/internals"
|
19
19
|
require "raygun/apm/hooks/net_http"
|
20
20
|
# conditionally required - may not be bundled
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
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
|
25
27
|
end
|
data/lib/raygun/apm/blacklist.rb
CHANGED
@@ -158,6 +158,8 @@ module Raygun
|
|
158
158
|
FileUtils::
|
159
159
|
TempFile#
|
160
160
|
TempFile::
|
161
|
+
Logger#
|
162
|
+
Logger::
|
161
163
|
}
|
162
164
|
|
163
165
|
INTERNALS = %w{
|
@@ -250,6 +252,10 @@ module Raygun
|
|
250
252
|
}
|
251
253
|
|
252
254
|
QUERIES = %w{
|
255
|
+
#mongodb
|
256
|
+
Mongo
|
257
|
+
BSON
|
258
|
+
+Mongo::Operation::Executable#do_execute
|
253
259
|
#redis
|
254
260
|
Redis
|
255
261
|
+Redis#auth
|
data/lib/raygun/apm/config.rb
CHANGED
@@ -18,6 +18,9 @@ module Raygun
|
|
18
18
|
"production" => Tracer::ENV_PRODUCTION
|
19
19
|
}
|
20
20
|
|
21
|
+
DEFAULT_BLACKLIST_PATH_UNIX = "/usr/share/Raygun/Blacklist"
|
22
|
+
DEFAULT_BLACKLIST_PATH_WINDOWS = "C:\\ProgramData\\Raygun\\Blacklist"
|
23
|
+
|
21
24
|
attr_accessor :env
|
22
25
|
def initialize(env=ENV)
|
23
26
|
@env = env
|
@@ -62,19 +65,18 @@ module Raygun
|
|
62
65
|
config_var 'PROTON_FILE_IPC_FOLDER', as: String
|
63
66
|
config_var 'PROTON_USE_MULTICAST', as: String, default: 'False'
|
64
67
|
config_var 'PROTON_BATCH_IDLE_COUNTER', as: Integer, default: 500
|
68
|
+
## New - Ruby profiler
|
69
|
+
config_var 'PROTON_UDP_HOST', as: String, default: UDP_SINK_HOST
|
70
|
+
config_var 'PROTON_UDP_PORT', as: Integer, default: UDP_SINK_PORT
|
65
71
|
|
66
|
-
def
|
72
|
+
def proton_udp_host
|
67
73
|
if proton_use_multicast == 'True'
|
68
74
|
UDP_SINK_MULTICAST_HOST
|
69
75
|
else
|
70
|
-
UDP_SINK_HOST
|
76
|
+
env['PROTON_UDP_HOST'] ? env['PROTON_UDP_HOST'].to_s : UDP_SINK_HOST
|
71
77
|
end
|
72
78
|
end
|
73
79
|
|
74
|
-
def udp_port
|
75
|
-
UDP_SINK_PORT
|
76
|
-
end
|
77
|
-
|
78
80
|
def loglevel
|
79
81
|
LOGLEVELS[proton_debug_loglevel] || raise(ArgumentError, "invalid log level")
|
80
82
|
end
|
@@ -83,6 +85,13 @@ module Raygun
|
|
83
85
|
environment = env['RACK_ENV'] || env['RAILS_ENV'] || 'production'
|
84
86
|
ENVIRONMENTS[environment] || Tracer::ENV_PRODUCTION
|
85
87
|
end
|
88
|
+
|
89
|
+
# Prefer what is set by PROTON_USER_OVERRIDES_FILE env
|
90
|
+
def blacklist_file
|
91
|
+
return proton_user_overrides_file if proton_user_overrides_file
|
92
|
+
path = Gem.win_platform? ? DEFAULT_BLACKLIST_PATH_WINDOWS : DEFAULT_BLACKLIST_PATH_UNIX
|
93
|
+
"#{File.join(path, proton_api_key)}.txt"
|
94
|
+
end
|
86
95
|
end
|
87
96
|
end
|
88
97
|
end
|
@@ -5,7 +5,7 @@ module Raygun
|
|
5
5
|
module Apm
|
6
6
|
class Diagnostics
|
7
7
|
AGENT_STATE_DOWN = "\nThe 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_UNKNOWN = "\
|
8
|
+
AGENT_STATE_UNKNOWN = "\nThe Raygun APM Agent is reachable, but Unable to determine the state of the Agent at the moment."
|
9
9
|
AGENT_STATE_UP_MISCONFIGURED = "\nThe 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"
|
10
10
|
AGENT_STATE_UP_CONFIGURED = "\nThe Raygun APM Agent is configured properly!"
|
11
11
|
AGENT_MINIMUM_VERSION_NOT_MET = "\nVersion #{Raygun::Apm::VERSION} of the Raygun APM Profiler requires a minimum Agent version #{Raygun::Apm::MINIMUM_AGENT_VERSION}\nPlease download the latest Agent from https://raygun.com/documentation/product-guides/apm/agent/downloads/"
|
data/lib/raygun/apm/event.rb
CHANGED
@@ -4,6 +4,11 @@ module Raygun
|
|
4
4
|
def inspect
|
5
5
|
"#<#{self.class.name}:#{self.object_id}> length:#{self.length} pid:#{self[:pid]} tid:#{self[:tid]} timestamp:#{self[:timestamp]}"
|
6
6
|
end
|
7
|
+
class ExceptionThrown < Event
|
8
|
+
def inspect
|
9
|
+
super + " class:#{self[:class_name]}"
|
10
|
+
end
|
11
|
+
end
|
7
12
|
class ThreadStarted < Event
|
8
13
|
def inspect
|
9
14
|
super + " parent_tid:#{self[:parent_tid]}"
|
@@ -29,6 +34,11 @@ module Raygun
|
|
29
34
|
super + " url:#{self[:url]} verb:#{self[:verb]} status:#{self[:status]} duration:#{self[:duration]}"
|
30
35
|
end
|
31
36
|
end
|
37
|
+
class Sql < Event
|
38
|
+
def inspect
|
39
|
+
super + " provider:#{self[:provider]} host:#{self[:host]} query:#{self[:query]} database:#{self[:database]} duration:#{self[:duration]}"
|
40
|
+
end
|
41
|
+
end
|
32
42
|
class BeginTransaction < Event
|
33
43
|
def inspect
|
34
44
|
super + " api_key:#{self[:api_key]} technology_type:#{self[:technology_type]} process_type:#{self[:process_type]}"
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'mongo'
|
2
|
+
|
3
|
+
module Raygun
|
4
|
+
module Apm
|
5
|
+
module Hooks
|
6
|
+
module MongoDB
|
7
|
+
def do_execute(connection, client, options = {})
|
8
|
+
result = nil
|
9
|
+
if tracer = Raygun::Apm::Tracer.instance
|
10
|
+
started = tracer.now
|
11
|
+
result = super
|
12
|
+
ended = tracer.now
|
13
|
+
event = raygun_apm_sql_event
|
14
|
+
event[:pid] = Process.pid
|
15
|
+
event[:query] = raygun_format_query(connection)
|
16
|
+
event[:provider] = "mongodb"
|
17
|
+
event[:host] = connection.address.to_s
|
18
|
+
event[:database] = client.database.name
|
19
|
+
event[:duration] = ended - started
|
20
|
+
event[:timestamp] = started
|
21
|
+
event[:tid] = tracer.get_thread_id(Thread.current)
|
22
|
+
tracer.emit(event)
|
23
|
+
result
|
24
|
+
else
|
25
|
+
super
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
def raygun_format_query(connection)
|
31
|
+
payload = message(connection).payload
|
32
|
+
return "#{payload["database_name"]}.#{payload["command_name"]} #{payload["command"]}}"
|
33
|
+
end
|
34
|
+
|
35
|
+
def raygun_apm_sql_event
|
36
|
+
@_raygun_apm_sql_event ||= Raygun::Apm::Event::Sql.new
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
Mongo::Operation.constants.each do |operation|
|
44
|
+
Mongo::Operation.const_get(operation).prepend(Raygun::Apm::Hooks::MongoDB) rescue nil
|
45
|
+
end
|
data/lib/raygun/apm/tracer.rb
CHANGED
@@ -36,8 +36,8 @@ module Raygun
|
|
36
36
|
sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_SNDBUF, Tracer::BATCH_PACKET_SIZE)
|
37
37
|
self.udp_sink(
|
38
38
|
socket: sock,
|
39
|
-
host: config.
|
40
|
-
port: config.
|
39
|
+
host: config.proton_udp_host,
|
40
|
+
port: config.proton_udp_port,
|
41
41
|
receive_buffer_size: sock.getsockopt(Socket::SOL_SOCKET, Socket::SO_RCVBUF).int
|
42
42
|
)
|
43
43
|
# Any fails here is kamikaze for the tracer
|
@@ -57,20 +57,23 @@ module Raygun
|
|
57
57
|
|
58
58
|
def initialize_blacklist
|
59
59
|
@blacklist_parser = Raygun::Apm::Blacklist::Parser.new(self)
|
60
|
-
|
61
|
-
|
60
|
+
file = @config.blacklist_file
|
61
|
+
@blacklist = if file && File.exist?(file)
|
62
|
+
File.readlines(file)
|
62
63
|
else
|
63
64
|
[]
|
64
65
|
end
|
65
|
-
# From file
|
66
|
-
@blacklist_parser.add_filters @blacklist
|
67
66
|
# Defaults
|
68
67
|
@blacklist_parser.add_filters Raygun::Apm::Blacklist.resolve_entries
|
68
|
+
# From file
|
69
|
+
@blacklist_parser.add_filters @blacklist
|
69
70
|
end
|
70
71
|
|
71
72
|
def register_known_library_paths
|
72
73
|
if defined?(Bundler)
|
73
|
-
|
74
|
+
libs = Bundler.load.specs.map(&:full_gem_path).sort << RbConfig::CONFIG['rubylibdir']
|
75
|
+
libs.delete(Dir.getwd)
|
76
|
+
self.register_libraries libs
|
74
77
|
else
|
75
78
|
self.register_libraries [RbConfig::CONFIG['rubylibdir']]
|
76
79
|
end
|
data/lib/raygun/apm/version.rb
CHANGED
data/raygun-apm.gemspec
CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
|
|
14
14
|
|
15
15
|
spec.files = Dir['README.rdoc', 'raygun-apm.gemspec', 'lib/**/*', 'bin/**/*'].reject { |f| f.match(/raygun_ext\./) }
|
16
16
|
spec.files += Dir['lib/raygun/**/{2}*/raygun_ext.*']
|
17
|
-
spec.bindir = "
|
17
|
+
spec.bindir = "bin"
|
18
18
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
19
|
spec.require_paths = ["lib", "ext"]
|
20
20
|
|
@@ -36,4 +36,5 @@ Gem::Specification.new do |spec|
|
|
36
36
|
spec.add_development_dependency "excon", "~> 0.73.0"
|
37
37
|
spec.add_development_dependency "httparty", "~> 0.18.0"
|
38
38
|
spec.add_development_dependency "httpclient", "~> 2.8.3"
|
39
|
+
spec.add_development_dependency "mongoid", "~> 7.1.2"
|
39
40
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
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.73
|
5
5
|
platform: x86-mingw32
|
6
6
|
authors:
|
7
7
|
- Raygun
|
8
8
|
- Erkki Eilonen
|
9
9
|
autorequire:
|
10
|
-
bindir:
|
10
|
+
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-10-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: debase-ruby_core_source
|
@@ -193,6 +193,20 @@ dependencies:
|
|
193
193
|
- - "~>"
|
194
194
|
- !ruby/object:Gem::Version
|
195
195
|
version: 2.8.3
|
196
|
+
- !ruby/object:Gem::Dependency
|
197
|
+
name: mongoid
|
198
|
+
requirement: !ruby/object:Gem::Requirement
|
199
|
+
requirements:
|
200
|
+
- - "~>"
|
201
|
+
- !ruby/object:Gem::Version
|
202
|
+
version: 7.1.2
|
203
|
+
type: :development
|
204
|
+
prerelease: false
|
205
|
+
version_requirements: !ruby/object:Gem::Requirement
|
206
|
+
requirements:
|
207
|
+
- - "~>"
|
208
|
+
- !ruby/object:Gem::Version
|
209
|
+
version: 7.1.2
|
196
210
|
description:
|
197
211
|
email:
|
198
212
|
- support@raygun.com
|
@@ -203,7 +217,7 @@ extra_rdoc_files: []
|
|
203
217
|
files:
|
204
218
|
- README.rdoc
|
205
219
|
- bin/console
|
206
|
-
- bin/diagnostics
|
220
|
+
- bin/raygun-diagnostics
|
207
221
|
- bin/setup
|
208
222
|
- ext/raygun/extconf.rb
|
209
223
|
- lib/raygun/2.5/raygun_ext.so
|
@@ -219,6 +233,7 @@ files:
|
|
219
233
|
- lib/raygun/apm/hooks/excon.rb
|
220
234
|
- lib/raygun/apm/hooks/httpclient.rb
|
221
235
|
- lib/raygun/apm/hooks/internals.rb
|
236
|
+
- lib/raygun/apm/hooks/mongodb.rb
|
222
237
|
- lib/raygun/apm/hooks/net_http.rb
|
223
238
|
- lib/raygun/apm/hooks/redis.rb
|
224
239
|
- lib/raygun/apm/tracer.rb
|