raygun-apm 1.0.46-x86-linux → 1.0.52-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: 47dfe411421250af598e42e39d872aeae9c4474564ecdf949305b387352fb54c
4
- data.tar.gz: 62328cfb3a6ba83b7bb3e36279cc2e8f9d8ce6a922a67d7bcd2816d7e9cc8322
3
+ metadata.gz: 02fa1c570b93b8e0004051ea1f35e434cc5ae676936600bfa7221204babfa477
4
+ data.tar.gz: 353e746a8da8cbaaa8f0d0a33578497f358c50054b25f641b4c8004549bf14f6
5
5
  SHA512:
6
- metadata.gz: 676779cb3c767d1e9ffed178cc8e4001ba07d1726aa167f933888dbe9b6ed898f6425f74a380cbf33ed91eaa530e8e2b071c2348ce80ca0648a5c26ab823b44a
7
- data.tar.gz: 61c53690f29abd822a124380535b78d97c15fc5077581a02b2655b0dfbc9c8332cd199efda56faa7e37e9261ad97cf22a6332766f1a5d9168e03fb403f9f2a15
6
+ metadata.gz: 96f9e5c87256e4ba7ff69e3ef49af6c837c16b14e090c837e4e0fd91bad9d05b5d0ee03b1dde16811853332f249c7c67e317dab714c6c7f7b157a4411e57d0da
7
+ data.tar.gz: e3442e87e22aa9176cae52c5d2b62ef2a399b7d657996f205a9453ef0158a5f739fef1762689d8de5e6cbf2333f0b5a4f181342ba9ed4091357b22a7009dac5f
@@ -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
 
@@ -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
@@ -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
@@ -140,11 +140,38 @@ 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#
146
149
  ERB#
147
150
  ERB::
151
+ Gem#
152
+ Gem::
153
+ FileUtils#
154
+ FileUtils::
155
+ TempFile#
156
+ TempFile::
157
+ }
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
148
175
  }
149
176
 
150
177
  HTTP_OUT = %w{
@@ -426,7 +453,7 @@ module Raygun
426
453
  end
427
454
 
428
455
  def self.resolve_entries
429
- DEFAULT_RUBY + PROFILER + HTTP_OUT + QUERIES + RAYGUN4RUBY + self.extended_blacklist.flatten
456
+ DEFAULT_RUBY + PROFILER + INTERNALS + HTTP_OUT + QUERIES + RAYGUN4RUBY + self.extended_blacklist.flatten
430
457
  end
431
458
  end
432
459
  end
@@ -4,31 +4,49 @@ require "json"
4
4
  module Raygun
5
5
  module Apm
6
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!"
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/"
10
12
 
11
13
  def initialize(host: Apm::Config::TCP_MANAGEMENT_HOST, port: Apm::Config::TCP_MANAGEMENT_PORT)
12
14
  @host = host
13
15
  @port = port
14
16
  end
15
17
 
16
- def verify_agent
18
+ def verify_agent(tracer)
17
19
  socket.write "GetAgentInfo"
18
20
  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
21
+ if minimum_agent_version_not_met?(response['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
23
30
  end
24
31
  rescue Errno::ECONNREFUSED
25
32
  puts AGENT_STATE_DOWN
33
+ rescue
34
+ puts AGENT_STATE_UNKNOWN
26
35
  end
27
36
 
28
37
  private
29
38
  def socket
30
39
  @socket ||= s = TCPSocket.new(@host, @port)
31
40
  end
41
+
42
+ def minimum_agent_version_not_met?(version)
43
+ # Legacy path
44
+ if String === version
45
+ version < Raygun::Apm::MINIMUM_AGENT_VERSION
46
+ else
47
+ "#{version['Major']}.#{version['Minor']}.#{version['Build']}.#{version['Revision']}" < Raygun::Apm::MINIMUM_AGENT_VERSION
48
+ end
49
+ end
32
50
  end
33
51
  end
34
52
  end
@@ -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
@@ -69,12 +69,16 @@ module Raygun
69
69
  end
70
70
 
71
71
  def register_known_library_paths
72
- self.register_libraries Bundler.load.specs.map(&:full_gem_path).sort << RbConfig::CONFIG['rubylibdir']
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
@@ -1,5 +1,6 @@
1
1
  module Raygun
2
2
  module Apm
3
- VERSION = "1.0.46"
3
+ VERSION = "1.0.52"
4
+ MINIMUM_AGENT_VERSION = "1.0.1190.0"
4
5
  end
5
6
  end
@@ -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 = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|vendor|tools|ext)/}) || f.match(%r{Rakefile|Gemfile|CHANGELOG|.git}) }
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.46
4
+ version: 1.0.52
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-06-27 00:00:00.000000000 Z
12
+ date: 2020-07-27 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