raygun-apm 1.0.49-universal-darwin → 1.0.51-universal-darwin

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a6ee4985c968ef34d9e6c303ad25b11f1e66ac5b4afe9d57f2e045cccd84e7ed
4
- data.tar.gz: 2283bbb34c45395d865be2cde588127c288d3195ca0f5d744a296580c210e049
3
+ metadata.gz: 7593b0e9bb1cba72a535be3ef08424e91284f2dd291ffe3fbb0fe2a604983bd6
4
+ data.tar.gz: 2a9aba1d39886397edfddfd38df5566bbf06770cb6509efd67dbad10fa2f911f
5
5
  SHA512:
6
- metadata.gz: 7864703c49d89935592ac3efb793bdbaa4a5a492f62b760b062626d66cc4c78dd14b5b38a6eb73b307bca6ec614f33405956ffe04ab702430360fd91eb4fe450
7
- data.tar.gz: 7fdb9a2dba8f5971282fa3fab7c83558c8ca223b0666843b665a0ae9111fa7f5b1e2c59cc4213c49fed032ee0d758d345d16baf93c8cbbbcca3068030019c203
6
+ metadata.gz: 5511a1acfb63fce2b2453e2d2cb96284a8b028cbc7404287e7a518383231a605f7711e00080aaa0a29a042e85d0c47ea05b3c4efcbb25d1366c524ce66b5fcf8
7
+ data.tar.gz: 7e01408c3b4462756ae526564ca4f5974213dd13db9c03b333e657e2fe96c95b427947d02c55504a0ba675bdd277c89f7fa498b4628cde6188bcebea97e37706
@@ -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
 
@@ -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,29 @@ 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/"
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['Status'] == 1
21
- puts AGENT_STATE_UP_CONFIGURED
22
- elsif response['Status'] == 0
23
- puts AGENT_STATE_UP_MISCONFIGURED
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
@@ -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.51"
4
+ MINIMUM_AGENT_VERSION = "1.0.1186.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.51
5
5
  platform: universal-darwin
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-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