raygun-apm 1.0.49-x86-linux → 1.0.51-x86-linux
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +1 -1
- data/ext/raygun/extconf.rb +3 -1
- 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/blacklist.rb +22 -1
- data/lib/raygun/apm/diagnostics.rb +15 -9
- data/lib/raygun/apm/hooks/excon.rb +36 -0
- data/lib/raygun/apm/hooks/httpclient.rb +36 -0
- data/lib/raygun/apm/hooks/internals.rb +74 -0
- data/lib/raygun/apm/tracer.rb +6 -2
- data/lib/raygun/apm/version.rb +2 -1
- data/lib/raygun/apm.rb +11 -0
- data/raygun-apm.gemspec +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 137abde428560aea5e42f842edd60f9c59258659e45ec4b5434f739778166179
|
4
|
+
data.tar.gz: 311d37fa1758e35249b541b39e11cb2e71ab97eaf122e3e55a17bc7942370b18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d09a8c94d20d67bcd351f62f9146a91260bc30def56d12a82b9022670dfd07ef00fffaf02161013ee086c81d010563e2a6b939d5da1a3a917926ffb2a926f430
|
7
|
+
data.tar.gz: a6d6daea28d595332f476e56f8281519a9dbbb10d06db912fd996551ca4ac9d5d789735dfdeb3435dab4715986567b71353c534b5f85c7c8343f9b6f187d90d9
|
data/README.rdoc
CHANGED
@@ -49,7 +49,7 @@ The Linux version can be installed either using {systemd}[https://raygun.com/doc
|
|
49
49
|
|
50
50
|
On windows the agent can be installed either via {MSI installer}[https://raygun.com/documentation/product-guides/apm/agent/installation/#installing-on-linux-using-terminal] or on {.NET core}[https://raygun.com/documentation/product-guides/apm/agent/installation/#installing-on-windows-net-core]
|
51
51
|
|
52
|
-
== Ruby on Rails
|
52
|
+
== Ruby on Rails
|
53
53
|
|
54
54
|
For Rails support see {documentation}[https://www.rubydoc.info/gems/raygun-apm-rails/0.1.0] of the railgun-apm-rails gem.
|
55
55
|
|
data/ext/raygun/extconf.rb
CHANGED
@@ -10,6 +10,9 @@ headers = proc do
|
|
10
10
|
end
|
11
11
|
|
12
12
|
dir_config('raygun')
|
13
|
+
|
14
|
+
RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
|
15
|
+
|
13
16
|
append_cflags '-pedantic'
|
14
17
|
append_cflags '-Wall'
|
15
18
|
append_cflags '-Werror=switch'
|
@@ -27,7 +30,6 @@ if ENV['DEBUG']
|
|
27
30
|
append_cflags '-fstack-protector-all'
|
28
31
|
append_cflags '-DRB_RG_DEBUG'
|
29
32
|
else
|
30
|
-
#append_cflags '-DRAX_DEBUG_MSG'
|
31
33
|
append_cflags '-O3'
|
32
34
|
end
|
33
35
|
|
Binary file
|
Binary file
|
Binary file
|
data/lib/raygun/apm/blacklist.rb
CHANGED
@@ -140,6 +140,9 @@ module Raygun
|
|
140
140
|
Delegator#
|
141
141
|
PrettyPrint#
|
142
142
|
PP#
|
143
|
+
PP::
|
144
|
+
PrettyPrint#
|
145
|
+
PrettyPrint::
|
143
146
|
Minitest
|
144
147
|
Psych
|
145
148
|
Mutex_m#
|
@@ -153,6 +156,24 @@ module Raygun
|
|
153
156
|
TempFile::
|
154
157
|
}
|
155
158
|
|
159
|
+
INTERNALS = %w{
|
160
|
+
+Object#sleep
|
161
|
+
+Object#exec
|
162
|
+
+Object#fork
|
163
|
+
+Object#system
|
164
|
+
+Object#spawn
|
165
|
+
+Continuation#callcc
|
166
|
+
+IO#syscall
|
167
|
+
+IO#open
|
168
|
+
+IO#puts
|
169
|
+
+IO#gets
|
170
|
+
+IO#readline
|
171
|
+
+IO#readlines
|
172
|
+
+Random#srand
|
173
|
+
+Random#rand
|
174
|
+
+Signal#trap
|
175
|
+
}
|
176
|
+
|
156
177
|
HTTP_OUT = %w{
|
157
178
|
#Faraday
|
158
179
|
URI
|
@@ -432,7 +453,7 @@ module Raygun
|
|
432
453
|
end
|
433
454
|
|
434
455
|
def self.resolve_entries
|
435
|
-
DEFAULT_RUBY + PROFILER + HTTP_OUT + QUERIES + RAYGUN4RUBY + self.extended_blacklist.flatten
|
456
|
+
DEFAULT_RUBY + PROFILER + INTERNALS + HTTP_OUT + QUERIES + RAYGUN4RUBY + self.extended_blacklist.flatten
|
436
457
|
end
|
437
458
|
end
|
438
459
|
end
|
@@ -4,23 +4,29 @@ require "json"
|
|
4
4
|
module Raygun
|
5
5
|
module Apm
|
6
6
|
class Diagnostics
|
7
|
-
AGENT_STATE_DOWN = "
|
8
|
-
AGENT_STATE_UNKNOWN = "
|
9
|
-
AGENT_STATE_UP_MISCONFIGURED = "
|
10
|
-
AGENT_STATE_UP_CONFIGURED = "
|
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 = "\nUnable to determine the state of the Raygun APM Agent."
|
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
|
+
AGENT_STATE_UP_CONFIGURED = "\nThe Raygun APM Agent is configured properly!"
|
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/"
|
11
12
|
|
12
13
|
def initialize(host: Apm::Config::TCP_MANAGEMENT_HOST, port: Apm::Config::TCP_MANAGEMENT_PORT)
|
13
14
|
@host = host
|
14
15
|
@port = port
|
15
16
|
end
|
16
17
|
|
17
|
-
def verify_agent
|
18
|
+
def verify_agent(tracer)
|
18
19
|
socket.write "GetAgentInfo"
|
19
20
|
response = JSON.parse(socket.gets)
|
20
|
-
if response['
|
21
|
-
puts
|
22
|
-
|
23
|
-
|
21
|
+
if response['Version'] < Raygun::Apm::MINIMUM_AGENT_VERSION
|
22
|
+
puts AGENT_MINIMUM_VERSION_NOT_MET
|
23
|
+
tracer.noop!
|
24
|
+
else
|
25
|
+
if response['Status'] == 1
|
26
|
+
puts AGENT_STATE_UP_CONFIGURED
|
27
|
+
elsif response['Status'] == 0
|
28
|
+
puts AGENT_STATE_UP_MISCONFIGURED
|
29
|
+
end
|
24
30
|
end
|
25
31
|
rescue Errno::ECONNREFUSED
|
26
32
|
puts AGENT_STATE_DOWN
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'excon'
|
2
|
+
|
3
|
+
module Raygun
|
4
|
+
module Apm
|
5
|
+
module Hooks
|
6
|
+
module Excon
|
7
|
+
def request(params={}, &block)
|
8
|
+
if tracer = Raygun::Apm::Tracer.instance
|
9
|
+
started = tracer.now
|
10
|
+
response = super
|
11
|
+
ended = tracer.now
|
12
|
+
event = raygun_apm_http_out_event
|
13
|
+
event[:pid] = Process.pid
|
14
|
+
event[:url] = "#{@data[:scheme]}://#{@data[:host]}/#{params[:path]}"
|
15
|
+
event[:verb] = params[:method].to_s.upcase
|
16
|
+
event[:status] = response.status
|
17
|
+
event[:duration] = ended - started
|
18
|
+
event[:timestamp] = started
|
19
|
+
event[:tid] = tracer.get_thread_id(Thread.current)
|
20
|
+
tracer.emit(event)
|
21
|
+
response
|
22
|
+
else
|
23
|
+
super
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
def raygun_apm_http_out_event
|
29
|
+
@_raygun_apm_http_out_event ||= Raygun::Apm::Event::HttpOut.new
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
Excon::Connection.prepend(Raygun::Apm::Hooks::Excon)
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'httpclient'
|
2
|
+
|
3
|
+
module Raygun
|
4
|
+
module Apm
|
5
|
+
module Hooks
|
6
|
+
module HTTPClient
|
7
|
+
def do_request(method, uri, query, body, header, &filtered_block)
|
8
|
+
if tracer = Raygun::Apm::Tracer.instance
|
9
|
+
started = tracer.now
|
10
|
+
response = super
|
11
|
+
ended = tracer.now
|
12
|
+
event = raygun_apm_http_out_event
|
13
|
+
event[:pid] = Process.pid
|
14
|
+
event[:url] = query ? URI.join(uri, query).to_s : uri.to_s
|
15
|
+
event[:verb] = method.to_s.upcase
|
16
|
+
event[:status] = response.code.to_i
|
17
|
+
event[:duration] = ended - started
|
18
|
+
event[:timestamp] = started
|
19
|
+
event[:tid] = tracer.get_thread_id(Thread.current)
|
20
|
+
tracer.emit(event)
|
21
|
+
response
|
22
|
+
else
|
23
|
+
super
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
def raygun_apm_http_out_event
|
29
|
+
@_raygun_apm_http_out_event ||= Raygun::Apm::Event::HttpOut.new
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
HTTPClient.prepend(Raygun::Apm::Hooks::HTTPClient)
|
@@ -0,0 +1,74 @@
|
|
1
|
+
module Raygun
|
2
|
+
module Apm
|
3
|
+
module Hooks
|
4
|
+
module Object
|
5
|
+
def system(*args)
|
6
|
+
super
|
7
|
+
end
|
8
|
+
|
9
|
+
def sleep(*args)
|
10
|
+
super
|
11
|
+
end
|
12
|
+
|
13
|
+
def exec(*args)
|
14
|
+
super
|
15
|
+
end
|
16
|
+
|
17
|
+
def spawn(*args)
|
18
|
+
super
|
19
|
+
end
|
20
|
+
|
21
|
+
def fork(*args)
|
22
|
+
super
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
module IO
|
27
|
+
def sycall(*args)
|
28
|
+
super
|
29
|
+
end
|
30
|
+
|
31
|
+
def open(*args)
|
32
|
+
super
|
33
|
+
end
|
34
|
+
|
35
|
+
def puts(*args)
|
36
|
+
super
|
37
|
+
end
|
38
|
+
|
39
|
+
def gets(*args)
|
40
|
+
super
|
41
|
+
end
|
42
|
+
|
43
|
+
def readline(*args)
|
44
|
+
super
|
45
|
+
end
|
46
|
+
|
47
|
+
def readlines(*args)
|
48
|
+
super
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
module Random
|
53
|
+
def srand(*args)
|
54
|
+
super
|
55
|
+
end
|
56
|
+
|
57
|
+
def rand(*args)
|
58
|
+
super
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
module Signal
|
63
|
+
def trap(*args)
|
64
|
+
super
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
Object.prepend Raygun::Apm::Hooks::Object
|
72
|
+
IO.prepend Raygun::Apm::Hooks::IO
|
73
|
+
Random.prepend Raygun::Apm::Hooks::Random
|
74
|
+
Signal.prepend Raygun::Apm::Hooks::Signal
|
data/lib/raygun/apm/tracer.rb
CHANGED
@@ -69,12 +69,16 @@ module Raygun
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def register_known_library_paths
|
72
|
-
|
72
|
+
if defined?(Bundler)
|
73
|
+
self.register_libraries Bundler.load.specs.map(&:full_gem_path).sort << RbConfig::CONFIG['rubylibdir']
|
74
|
+
else
|
75
|
+
self.register_libraries [RbConfig::CONFIG['rubylibdir']]
|
76
|
+
end
|
73
77
|
end
|
74
78
|
|
75
79
|
def run_agent_connectivity_diagnostics
|
76
80
|
check = Raygun::Apm::Diagnostics.new
|
77
|
-
check.verify_agent
|
81
|
+
check.verify_agent(self)
|
78
82
|
end
|
79
83
|
end
|
80
84
|
end
|
data/lib/raygun/apm/version.rb
CHANGED
data/lib/raygun/apm.rb
CHANGED
@@ -1,14 +1,25 @@
|
|
1
1
|
require "raygun/apm/version"
|
2
|
+
|
2
3
|
begin
|
4
|
+
# Attempt to load a precompiled shared object (released gem)
|
3
5
|
RUBY_VERSION =~ /(\d+\.\d+)/
|
4
6
|
require "raygun/#{$1}/raygun_ext"
|
5
7
|
rescue LoadError
|
8
|
+
# Attempt to load the development specific extension (non-released gem, local dev)
|
6
9
|
require "raygun/raygun_ext"
|
7
10
|
end
|
11
|
+
|
8
12
|
require "raygun/apm/config"
|
9
13
|
require "raygun/apm/diagnostics"
|
10
14
|
require "raygun/apm/blacklist/parser"
|
11
15
|
require "raygun/apm/blacklist/translator"
|
12
16
|
require "raygun/apm/tracer"
|
13
17
|
require "raygun/apm/event"
|
18
|
+
require "raygun/apm/hooks/internals"
|
14
19
|
require "raygun/apm/hooks/net_http"
|
20
|
+
# conditionally required - may not be bundled
|
21
|
+
begin
|
22
|
+
require "raygun/apm/hooks/httpclient"
|
23
|
+
require "raygun/apm/hooks/excon"
|
24
|
+
rescue LoadError
|
25
|
+
end
|
data/raygun-apm.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.homepage = "https://raygun.com/platform/apm"
|
13
13
|
#spec.license = "MIT"
|
14
14
|
|
15
|
-
spec.files =
|
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
17
|
spec.bindir = "exe"
|
18
18
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
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.51
|
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-07-
|
12
|
+
date: 2020-07-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: debase-ruby_core_source
|
@@ -216,6 +216,9 @@ files:
|
|
216
216
|
- lib/raygun/apm/config.rb
|
217
217
|
- lib/raygun/apm/diagnostics.rb
|
218
218
|
- lib/raygun/apm/event.rb
|
219
|
+
- lib/raygun/apm/hooks/excon.rb
|
220
|
+
- lib/raygun/apm/hooks/httpclient.rb
|
221
|
+
- lib/raygun/apm/hooks/internals.rb
|
219
222
|
- lib/raygun/apm/hooks/net_http.rb
|
220
223
|
- lib/raygun/apm/hooks/redis.rb
|
221
224
|
- lib/raygun/apm/tracer.rb
|