raygun-apm 1.0.49-x64-mingw32 → 1.0.55-x64-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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a1abf77c275bb0167d6e17da5bfcd41cdbb552fa93da1d59aa1aed2a5e6a741
4
- data.tar.gz: 77cc991ecf48959a20df63f51c324a8ab79eb3a5f2b87dedd0865e0d87875dea
3
+ metadata.gz: a9e5ced3d30b4067d3c3737a7ee224ccf7669f355d8c3a621cafb336ab1ee022
4
+ data.tar.gz: c7b148bb21c3c5e9e67175abe72fc248efc450a75a8e8cc515210272f136fff2
5
5
  SHA512:
6
- metadata.gz: 2ec78d4b56bddd48815d2146dcef1094a677d8f51ea96a111fe733fa7299766b9e123d8020863f1e347fb9e1f09dbd25221b50102987954e38de5b024ba8e86a
7
- data.tar.gz: cc3edca6bae7fc51638ada0bd1bbd8b56f7e400a0a17860c636935e3e98b7dda2c6260d7d42924ad624b4cadf82be8d3716335939bfbd334bab937a39e4a05a0
6
+ metadata.gz: beeab76cc197c19be27d96cc2536940624c2c7b52cd0545f6e869d7cd0f304cc612b0f74b2bb81a58e667798d742bec0730bf78794304a785664842dfca83a48
7
+ data.tar.gz: 10c21b8ca8e4168c145c9013fc68fefb4e6a754ce6ac6ff72f365670603eb02512f7b02287d87c1d32296a92d2a59d1ac9e9071a568dce9544d715cc321a0220
@@ -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,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,31 @@ 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_UNKNOWN = "Unable to determine the state of the Raygun APM Agent."
9
- 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"
10
- 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/"
12
+ PROFILER_NOOPED = "Profiler loaded in noop mode and will be disabled due to the minimum Agent version not met"
11
13
 
12
14
  def initialize(host: Apm::Config::TCP_MANAGEMENT_HOST, port: Apm::Config::TCP_MANAGEMENT_PORT)
13
15
  @host = host
14
16
  @port = port
15
17
  end
16
18
 
17
- def verify_agent
19
+ def verify_agent(tracer)
18
20
  socket.write "GetAgentInfo"
19
21
  response = JSON.parse(socket.gets)
20
- if response['Status'] == 1
21
- puts AGENT_STATE_UP_CONFIGURED
22
- elsif response['Status'] == 0
23
- puts AGENT_STATE_UP_MISCONFIGURED
22
+ if minimum_agent_version_not_met?(response['Version'])
23
+ puts AGENT_MINIMUM_VERSION_NOT_MET
24
+ tracer.noop!
25
+ puts PROFILER_NOOPED
26
+ else
27
+ if response['Status'] == 1
28
+ puts AGENT_STATE_UP_CONFIGURED
29
+ elsif response['Status'] == 0
30
+ puts AGENT_STATE_UP_MISCONFIGURED
31
+ end
24
32
  end
25
33
  rescue Errno::ECONNREFUSED
26
34
  puts AGENT_STATE_DOWN
@@ -32,6 +40,15 @@ module Raygun
32
40
  def socket
33
41
  @socket ||= s = TCPSocket.new(@host, @port)
34
42
  end
43
+
44
+ def minimum_agent_version_not_met?(version)
45
+ # Legacy path
46
+ if String === version
47
+ version < Raygun::Apm::MINIMUM_AGENT_VERSION
48
+ else
49
+ "#{version['Major']}.#{version['Minor']}.#{version['Build']}.#{version['Revision']}" < Raygun::Apm::MINIMUM_AGENT_VERSION
50
+ end
51
+ end
35
52
  end
36
53
  end
37
54
  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.49"
3
+ VERSION = "1.0.55"
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.49
4
+ version: 1.0.55
5
5
  platform: x64-mingw32
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-01 00:00:00.000000000 Z
12
+ date: 2020-08-01 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