raygun-apm 0.0.3-x86-linux
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +34 -0
- data/README.md +0 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/ext/raygun/extconf.rb +41 -0
- data/lib/raygun/apm/blacklist.rb +195 -0
- data/lib/raygun/apm/config.rb +77 -0
- data/lib/raygun/apm/event.rb +24 -0
- data/lib/raygun/apm/middleware.rb +98 -0
- data/lib/raygun/apm/tracer.rb +58 -0
- data/lib/raygun/apm/version.rb +5 -0
- data/lib/raygun/apm.rb +16 -0
- data/lib/raygun/raygun_ext.so +0 -0
- data/raygun-apm.gemspec +32 -0
- metadata +160 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a1772cfb1a94b405799e986f482d25bdd94c6a5538a978a618a4a17a986313b2
|
4
|
+
data.tar.gz: c916a2ab478d4a5f2b040faba3168936735bb702ae7808a64800c4ebf9c88baf
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a5ba473a57a7e1431568b20f6085368a265255694f2ec40048d8d78af0c98732c2c1da4cb064a899adab695fa8fd14a5e1925dca734d60fb6ff91fb76d95d8fc
|
7
|
+
data.tar.gz: 92d8a058ef4295d81d0579b70468804f86f6db65b52f28ffef4a641c76618a8dbb8b907583d593a46d449c165d676596c13d8dd95db89af2bceff4a12204d2ec
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
raygun-apm (0.0.3)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
benchmark_driver (0.14.17)
|
10
|
+
debase-ruby_core_source (0.10.6)
|
11
|
+
irb (1.0.0)
|
12
|
+
minitest (5.11.3)
|
13
|
+
rake (12.3.3)
|
14
|
+
rake-compiler (1.0.8)
|
15
|
+
rake
|
16
|
+
rake-compiler-dock (0.7.2)
|
17
|
+
|
18
|
+
PLATFORMS
|
19
|
+
ruby
|
20
|
+
x64-mingw32
|
21
|
+
|
22
|
+
DEPENDENCIES
|
23
|
+
benchmark_driver (~> 0.14.17)
|
24
|
+
bundler (~> 1.16)
|
25
|
+
debase-ruby_core_source (~> 0.10.6)
|
26
|
+
irb
|
27
|
+
minitest (~> 5.0)
|
28
|
+
rake (~> 12.0)
|
29
|
+
rake-compiler (~> 1.0.8)
|
30
|
+
rake-compiler-dock (~> 0.7.2)
|
31
|
+
raygun-apm!
|
32
|
+
|
33
|
+
BUNDLED WITH
|
34
|
+
1.17.2
|
data/README.md
ADDED
File without changes
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "raygun/apm"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'mkmf'
|
4
|
+
require 'debase/ruby_core_source'
|
5
|
+
|
6
|
+
headers = proc do
|
7
|
+
have_header('ruby.h') &&
|
8
|
+
have_header('ruby/debug.h') &&
|
9
|
+
have_header("vm_core.h")
|
10
|
+
end
|
11
|
+
|
12
|
+
dir_config('raygun')
|
13
|
+
append_cflags '-pedantic'
|
14
|
+
append_cflags '-Wall'
|
15
|
+
append_cflags '-Werror=switch'
|
16
|
+
append_cflags '-std=c99'
|
17
|
+
if ENV['DEBUG']
|
18
|
+
have_library 'ssp'
|
19
|
+
have_func '__stack_chk_guard'
|
20
|
+
have_func '__stack_chk_fail'
|
21
|
+
append_cflags '-ggdb3'
|
22
|
+
# Needed reduced -On levels for SSP to do its job.
|
23
|
+
# Used to be -O0 but switched to -Og since -O0 disables
|
24
|
+
# some optimizations that debug tools need.
|
25
|
+
# https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
|
26
|
+
append_cflags '-Og'
|
27
|
+
append_cflags '-fstack-protector-all'
|
28
|
+
else
|
29
|
+
append_cflags '-O3'
|
30
|
+
end
|
31
|
+
|
32
|
+
unless create_header
|
33
|
+
STDERR.print("extconf.h creation failed\n")
|
34
|
+
exit(1)
|
35
|
+
end
|
36
|
+
|
37
|
+
unless Debase::RubyCoreSource.create_makefile_with_core(headers, 'raygun_ext')
|
38
|
+
STDERR.print("Makefile creation failed\n")
|
39
|
+
STDERR.print("One or more ruby headers not found\n")
|
40
|
+
exit(1)
|
41
|
+
end
|
@@ -0,0 +1,195 @@
|
|
1
|
+
module Raygun
|
2
|
+
module Apm
|
3
|
+
class Blacklist
|
4
|
+
# From https://ruby-doc.org/core-2.6.3/ , to automate
|
5
|
+
DEFAULT_RUBY = %w{
|
6
|
+
ARGF
|
7
|
+
ArgumentError
|
8
|
+
Array
|
9
|
+
BasicObject
|
10
|
+
Binding
|
11
|
+
Class
|
12
|
+
ClosedQueueError
|
13
|
+
Comparable
|
14
|
+
Complex
|
15
|
+
ConditionVariable
|
16
|
+
Continuation
|
17
|
+
Data
|
18
|
+
Dir
|
19
|
+
ENV
|
20
|
+
EOFError
|
21
|
+
Encoding
|
22
|
+
Encoding::CompatibilityError
|
23
|
+
Encoding::Converter
|
24
|
+
Encoding::ConverterNotFoundError
|
25
|
+
Encoding::InvalidByteSequenceError
|
26
|
+
Encoding::UndefinedConversionError
|
27
|
+
EncodingError
|
28
|
+
Enumerable
|
29
|
+
Enumerator
|
30
|
+
Enumerator::ArithmeticSequence
|
31
|
+
Enumerator::Chain
|
32
|
+
Enumerator::Generator
|
33
|
+
Enumerator::Lazy
|
34
|
+
Enumerator::Yielder
|
35
|
+
Errno
|
36
|
+
Exception
|
37
|
+
FalseClass
|
38
|
+
Fiber
|
39
|
+
FiberError
|
40
|
+
File
|
41
|
+
File::Constants
|
42
|
+
File::Stat
|
43
|
+
FileTest
|
44
|
+
Float
|
45
|
+
FloatDomainError
|
46
|
+
FrozenError
|
47
|
+
GC
|
48
|
+
GC::Profiler
|
49
|
+
Hash
|
50
|
+
IO
|
51
|
+
IO::EAGAINWaitReadable
|
52
|
+
IO::EAGAINWaitWritable
|
53
|
+
IO::EINPROGRESSWaitReadable
|
54
|
+
IO::EINPROGRESSWaitWritable
|
55
|
+
IO::EWOULDBLOCKWaitReadable
|
56
|
+
IO::EWOULDBLOCKWaitWritable
|
57
|
+
IO::WaitReadable
|
58
|
+
IO::WaitWritable
|
59
|
+
IOError
|
60
|
+
IndexError
|
61
|
+
Integer
|
62
|
+
Interrupt
|
63
|
+
Kernel
|
64
|
+
KeyError
|
65
|
+
LoadError
|
66
|
+
LocalJumpError
|
67
|
+
Marshal
|
68
|
+
MatchData
|
69
|
+
Math
|
70
|
+
Math::DomainError
|
71
|
+
Method
|
72
|
+
Module
|
73
|
+
Mutex
|
74
|
+
NameError
|
75
|
+
NilClass
|
76
|
+
NoMemoryError
|
77
|
+
NoMethodError
|
78
|
+
NotImplementedError
|
79
|
+
Numeric
|
80
|
+
Object
|
81
|
+
ObjectSpace
|
82
|
+
ObjectSpace::WeakMap
|
83
|
+
Proc
|
84
|
+
Process
|
85
|
+
Process::GID
|
86
|
+
Process::Status
|
87
|
+
Process::Sys
|
88
|
+
Process::UID
|
89
|
+
Queue
|
90
|
+
Random
|
91
|
+
Random::Formatter
|
92
|
+
Range
|
93
|
+
RangeError
|
94
|
+
Rational
|
95
|
+
Regexp
|
96
|
+
RegexpError
|
97
|
+
RubyVM
|
98
|
+
RubyVM::AbstractSyntaxTree
|
99
|
+
RubyVM::AbstractSyntaxTree::Node
|
100
|
+
RubyVM::InstructionSequence
|
101
|
+
RubyVM::MJIT
|
102
|
+
RuntimeError
|
103
|
+
ScriptError
|
104
|
+
SecurityError
|
105
|
+
Set
|
106
|
+
Signal
|
107
|
+
SignalException
|
108
|
+
SizedQueue
|
109
|
+
StandardError
|
110
|
+
StopIteration
|
111
|
+
String
|
112
|
+
Struct
|
113
|
+
Symbol
|
114
|
+
SyntaxError
|
115
|
+
SystemCallError
|
116
|
+
SystemExit
|
117
|
+
SystemStackError
|
118
|
+
Thread
|
119
|
+
Thread::Backtrace
|
120
|
+
Thread::Backtrace::Location
|
121
|
+
ThreadError
|
122
|
+
ThreadGroup
|
123
|
+
Time
|
124
|
+
TracePoint
|
125
|
+
TrueClass
|
126
|
+
TypeError
|
127
|
+
UnboundMethod
|
128
|
+
UncaughtThrowError
|
129
|
+
UnicodeNormalize
|
130
|
+
Warning
|
131
|
+
ZeroDivisionError
|
132
|
+
}
|
133
|
+
|
134
|
+
# from https://api.rubyonrails.org/ , to automate
|
135
|
+
DEFAULT_RAILS = %w{
|
136
|
+
#<Class:
|
137
|
+
#<Module:
|
138
|
+
#<ActiveRecord:
|
139
|
+
#<ActiveModel:
|
140
|
+
Benchmark
|
141
|
+
BigDecimal
|
142
|
+
Concurrent
|
143
|
+
Date
|
144
|
+
DateAndTime
|
145
|
+
DateTime
|
146
|
+
Delegator
|
147
|
+
Digest
|
148
|
+
ERB
|
149
|
+
SecureRandom
|
150
|
+
URI
|
151
|
+
AbstractController
|
152
|
+
ActionCable
|
153
|
+
ActionController
|
154
|
+
ActionDispatch
|
155
|
+
ActionMailbox
|
156
|
+
ActionMailer
|
157
|
+
ActionText
|
158
|
+
ActionView
|
159
|
+
ActiveJob
|
160
|
+
ActiveModel
|
161
|
+
ActiveRecord
|
162
|
+
ActiveStorage
|
163
|
+
ActiveSupport
|
164
|
+
Arel
|
165
|
+
Mail
|
166
|
+
Mime
|
167
|
+
Rails
|
168
|
+
Rack
|
169
|
+
I18n
|
170
|
+
Bootsnap
|
171
|
+
Sprockets
|
172
|
+
Turbolinks
|
173
|
+
Pathname
|
174
|
+
MonitorMixin
|
175
|
+
Logger
|
176
|
+
Sprockets
|
177
|
+
ActionDispatch
|
178
|
+
ActiveSupport
|
179
|
+
ActionView
|
180
|
+
ApplicationHelper
|
181
|
+
SQLite3
|
182
|
+
Mysql2
|
183
|
+
Erubi
|
184
|
+
ApplicationController
|
185
|
+
}
|
186
|
+
def self.resolve_entries
|
187
|
+
if Gem.loaded_specs.has_key?('rails')
|
188
|
+
DEFAULT_RUBY + DEFAULT_RAILS
|
189
|
+
else
|
190
|
+
DEFAULT_RUBY
|
191
|
+
end
|
192
|
+
end
|
193
|
+
end
|
194
|
+
end
|
195
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
module Raygun
|
2
|
+
module Apm
|
3
|
+
class Config
|
4
|
+
LOGLEVELS = {
|
5
|
+
"None" => Tracer::LOG_NONE,
|
6
|
+
"Info" => Tracer::LOG_INFO,
|
7
|
+
"Warning" => Tracer::LOG_WARNING,
|
8
|
+
"Error" => Tracer::LOG_ERROR,
|
9
|
+
"Verbose" => Tracer::LOG_VERBOSE,
|
10
|
+
"Debug" => Tracer::LOG_DEBUG,
|
11
|
+
"Everything" => Tracer::LOG_EVERYTHING
|
12
|
+
}
|
13
|
+
attr_accessor :env
|
14
|
+
def initialize(env=ENV)
|
15
|
+
@env = env
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.cast_to_boolean(x)
|
19
|
+
case x
|
20
|
+
when true, 'true', 'True', 1, '1' then true
|
21
|
+
else
|
22
|
+
false
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.config_var(attr, opts={})
|
27
|
+
define_method attr.downcase do
|
28
|
+
val = if x = env[attr]
|
29
|
+
if opts[:as] == Integer
|
30
|
+
Integer(x)
|
31
|
+
elsif opts[:as] == String
|
32
|
+
x.to_s
|
33
|
+
elsif opts[:as] == :boolean
|
34
|
+
self.class.cast_to_boolean(x)
|
35
|
+
end
|
36
|
+
else
|
37
|
+
opts[:default]
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# Initial constants for ProtonAgentTail.exe
|
43
|
+
UDP_SINK_HOST = '127.0.0.1'
|
44
|
+
UDP_SINK_MULTICAST_HOST = '239.100.15.215'
|
45
|
+
UDP_SINK_PORT = 2799
|
46
|
+
|
47
|
+
## Enumerate all PROTON_ constants
|
48
|
+
config_var 'PROTON_DEBUG_LOGLEVEL', as: String, default: 'None'
|
49
|
+
config_var 'PROTON_USER_OVERRIDES_FILE', as: String
|
50
|
+
config_var 'PROTON_STARTUP_PERIOD', as: Integer, default: 0
|
51
|
+
config_var 'PROTON_NETWORK_MODE', as: String, default: 'Udp'
|
52
|
+
config_var 'PROTON_FILE_IPC_FOLDER', as: String
|
53
|
+
config_var 'PROTON_USE_MULTICAST', as: String, default: 'False'
|
54
|
+
config_var 'PROTON_BATCH_IDLE_COUNTER', as: Integer, default: 500
|
55
|
+
|
56
|
+
## ruby specific extras
|
57
|
+
config_var 'PROTON_RB_TRACE_BLOCKS', as: :boolean, default: false
|
58
|
+
config_var 'PROTON_EMIT_ARGUMENTS', as: :boolean, default: false
|
59
|
+
|
60
|
+
def udp_host
|
61
|
+
if proton_use_multicast == 'True'
|
62
|
+
UDP_SINK_MULTICAST_HOST
|
63
|
+
else
|
64
|
+
UDP_SINK_HOST
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def udp_port
|
69
|
+
UDP_SINK_PORT
|
70
|
+
end
|
71
|
+
|
72
|
+
def loglevel
|
73
|
+
LOGLEVELS[proton_debug_loglevel] || raise(ArgumentError, "invalid log level")
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Raygun
|
2
|
+
module Apm
|
3
|
+
class Event
|
4
|
+
def inspect
|
5
|
+
"#<#{self.class.name}:#{self.object_id}> length:#{self.length} pid:#{self[:pid]} tid:#{self[:tid]} timestamp:#{self[:timestamp]}"
|
6
|
+
end
|
7
|
+
class ThreadStarted < Event
|
8
|
+
def inspect
|
9
|
+
super + " "
|
10
|
+
end
|
11
|
+
end
|
12
|
+
class Begin < Event
|
13
|
+
def inspect
|
14
|
+
super + " function_id:#{self[:function_id]} instance_id:#{self[:instance_id]}"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
class Methodinfo < Event
|
18
|
+
def inspect
|
19
|
+
super + " function_id:#{self[:function_id]} class_name:#{self[:class_name]} method_name:#{self[:method_name]}"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,98 @@
|
|
1
|
+
module Raygun
|
2
|
+
module Apm
|
3
|
+
class Middleware
|
4
|
+
def initialize(app)
|
5
|
+
@app = app
|
6
|
+
@tracer = Raygun::Apm::Tracer.new
|
7
|
+
@tracer.udp_sink!
|
8
|
+
@tracer.process_started
|
9
|
+
ObjectSpace.define_finalizer(self, self.class.finalize(@tracer))
|
10
|
+
|
11
|
+
@http_in_subscriber = ActiveSupport::Notifications.subscribe('process_action.action_controller') do |*args|
|
12
|
+
http_in_handler(args)
|
13
|
+
end
|
14
|
+
@sql_subscriber = ActiveSupport::Notifications.subscribe('sql.active_record') do |*args|
|
15
|
+
sql_handler(args)
|
16
|
+
end
|
17
|
+
|
18
|
+
# If any kamikaze errors on init, shutdown the tracer
|
19
|
+
rescue Raygun::Apm::FatalError => e
|
20
|
+
kamikaze_handler(e)
|
21
|
+
end
|
22
|
+
|
23
|
+
def call(env)
|
24
|
+
@status, @headers, @response = instrument(env)
|
25
|
+
[@status, @headers, @response]
|
26
|
+
end
|
27
|
+
|
28
|
+
def instrument(env)
|
29
|
+
res = nil
|
30
|
+
# Can be nil if we had a kamikaze error
|
31
|
+
@tracer.start_trace if @tracer
|
32
|
+
res = @app.call(env)
|
33
|
+
# Can be nil if we had a kamikaze error
|
34
|
+
@tracer.end_trace if @tracer
|
35
|
+
res
|
36
|
+
rescue Raygun::APM::FatalError => e
|
37
|
+
kamikaze_handler(e)
|
38
|
+
end
|
39
|
+
|
40
|
+
def kamikaze_handler(exception)
|
41
|
+
warn "Raygun APM shutting down due to error - %s", e.message
|
42
|
+
# Kill extended event subcriptions
|
43
|
+
ActiveSupport::Notifications.unsubscribe(@http_in_subscriber)
|
44
|
+
ActiveSupport::Notifications.unsubscribe(@sql_subscriber)
|
45
|
+
# Shutdown the tracepoint if enabled to reduce any overhead and stall emission
|
46
|
+
@tracer.tracepoint.stop if @tracer.tracepoint.enabled?
|
47
|
+
# Let the GC clean up the sink thread through the finalizer below
|
48
|
+
@tracer = nil
|
49
|
+
end
|
50
|
+
|
51
|
+
def http_in_handler(args)
|
52
|
+
notification = ActiveSupport::Notifications::Event.new *args
|
53
|
+
if notification.payload[:exception]
|
54
|
+
# XXX notify?
|
55
|
+
return
|
56
|
+
end
|
57
|
+
req = Rack::Request.new notification.payload[:headers].env
|
58
|
+
event = Raygun::Apm::Event::HttpIn.new
|
59
|
+
event[:url] = req.url
|
60
|
+
event[:verb] = req.request_method
|
61
|
+
event[:status] = notification.payload[:status]
|
62
|
+
# XXX constant milliseconds to microseconds
|
63
|
+
event[:duration] = notification.duration * 1000
|
64
|
+
@tracer.emit(event)
|
65
|
+
rescue => e
|
66
|
+
# XXX report
|
67
|
+
end
|
68
|
+
|
69
|
+
def sql_handler(args)
|
70
|
+
notification = ActiveSupport::Notifications::Event.new *args
|
71
|
+
connection = if notification.payload[:connection]
|
72
|
+
notification.payload[:connection]
|
73
|
+
else
|
74
|
+
ObjectSpace._id2ref(notification.payload[:connection_id])
|
75
|
+
end
|
76
|
+
event = Raygun::Apm::Event::Sql.new
|
77
|
+
event[:query] = notification.payload[:sql]
|
78
|
+
|
79
|
+
# XXX this is hacky
|
80
|
+
if config = connection.instance_variable_get('@config')
|
81
|
+
event[:provider] = config[:adapter]
|
82
|
+
event[:host] = config[:host]
|
83
|
+
event[:database] = config[:database]
|
84
|
+
end
|
85
|
+
|
86
|
+
# XXX constant milliseconds to microseconds
|
87
|
+
event[:duration] = notification.duration * 1000
|
88
|
+
@tracer.emit(event)
|
89
|
+
rescue => e
|
90
|
+
# XXX report
|
91
|
+
end
|
92
|
+
|
93
|
+
def self.finalize(tracer)
|
94
|
+
proc {tracer.process_ended}
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
require 'raygun/apm/blacklist'
|
2
|
+
module Raygun
|
3
|
+
module Apm
|
4
|
+
class Tracer
|
5
|
+
attr_accessor :config
|
6
|
+
|
7
|
+
def initialize(env=ENV)
|
8
|
+
@config = Config.new(env)
|
9
|
+
@blacklist = if @config.proton_user_overrides_file && File.exists?(@config.proton_user_overrides_file)
|
10
|
+
File.readlines(@config.proton_user_overrides_file)
|
11
|
+
else
|
12
|
+
[]
|
13
|
+
end
|
14
|
+
@blacklist.each do |line|
|
15
|
+
line.strip!
|
16
|
+
if line.start_with?('#')
|
17
|
+
# comment
|
18
|
+
elsif line.start_with?('+')
|
19
|
+
add_whitelist line[1..-1]
|
20
|
+
elsif line.start_with?('-')
|
21
|
+
add_blacklist line[1..-1]
|
22
|
+
elsif line.size > 0
|
23
|
+
add_blacklist line
|
24
|
+
end
|
25
|
+
end
|
26
|
+
Raygun::Apm::Blacklist.resolve_entries.each do |line|
|
27
|
+
add_blacklist line
|
28
|
+
end
|
29
|
+
install_tracepoint(
|
30
|
+
startup_period: config.proton_startup_period,
|
31
|
+
trace_blocks: config.proton_rb_trace_blocks,
|
32
|
+
emit_arguments: config.proton_emit_arguments,
|
33
|
+
loglevel: config.loglevel
|
34
|
+
)
|
35
|
+
ObjectSpace.define_finalizer(self, proc{ tracepoint.disable })
|
36
|
+
# Any fails here is kamikaze for the tracer
|
37
|
+
rescue => e
|
38
|
+
# XXX works for the middleware wrapped case, not for standalone - revisit
|
39
|
+
raise Raygun::Apm::FatalError, "Raygun APM tracer could not be initialized: #{e.message}"
|
40
|
+
end
|
41
|
+
|
42
|
+
def udp_sink!
|
43
|
+
require "socket"
|
44
|
+
sock = UDPSocket.new
|
45
|
+
self.udp_sink(
|
46
|
+
socket: sock,
|
47
|
+
host: config.udp_host,
|
48
|
+
port: config.udp_port
|
49
|
+
)
|
50
|
+
# Any fails here is kamikaze for the tracer
|
51
|
+
rescue => e
|
52
|
+
# XXX works for the middleware wrapped case, not for standalone - revisit
|
53
|
+
raise Raygun::Apm::FatalError, "Raygun APM UDP sink could not be initialized: #{e.message}"
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
data/lib/raygun/apm.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require "raygun/apm/version"
|
2
|
+
begin
|
3
|
+
RUBY_VERSION =~ /(\d+\.\d+)/
|
4
|
+
require "raygun#{$1}/raygun_extension"
|
5
|
+
rescue LoadError
|
6
|
+
require "raygun/raygun_ext"
|
7
|
+
end
|
8
|
+
require "raygun/apm/config"
|
9
|
+
require "raygun/apm/tracer"
|
10
|
+
require "raygun/apm/event"
|
11
|
+
|
12
|
+
module Raygun
|
13
|
+
module Apm
|
14
|
+
# Your code goes here...
|
15
|
+
end
|
16
|
+
end
|
Binary file
|
data/raygun-apm.gemspec
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
|
2
|
+
require File.expand_path('../lib/raygun/apm/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |spec|
|
5
|
+
spec.name = "raygun-apm"
|
6
|
+
spec.version = Raygun::Apm::VERSION
|
7
|
+
spec.authors = ["Erkki Eilonen"]
|
8
|
+
spec.email = ["erkki@bearmetal.eu"]
|
9
|
+
|
10
|
+
spec.summary = %q{Raygun application performance monitoring}
|
11
|
+
#spec.description = %q{TODO: Write a longer description or delete this line.}
|
12
|
+
#spec.homepage = "TODO: Put your gem's website or public repo URL here."
|
13
|
+
|
14
|
+
# Specify which files should be added to the gem when it is released.
|
15
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|vendor|tools|ext)/}) || f.match(%r{Rakefile|.git}) }
|
17
|
+
spec.bindir = "exe"
|
18
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
|
+
spec.require_paths = ["lib", "ext"]
|
20
|
+
|
21
|
+
spec.platform = Gem::Platform::RUBY
|
22
|
+
spec.extensions = ["ext/raygun/extconf.rb"]
|
23
|
+
spec.required_ruby_version = '>= 2.4.0'
|
24
|
+
|
25
|
+
spec.add_development_dependency "debase-ruby_core_source", "~> 0.10.6"
|
26
|
+
spec.add_development_dependency "bundler", "~> 1.16"
|
27
|
+
spec.add_development_dependency "rake", "~> 12.0"
|
28
|
+
spec.add_development_dependency "minitest", "~> 5.0"
|
29
|
+
spec.add_development_dependency "rake-compiler", "~> 1.0.8"
|
30
|
+
spec.add_development_dependency "rake-compiler-dock", "~> 0.7.2"
|
31
|
+
spec.add_development_dependency "benchmark_driver", "~> 0.14.17"
|
32
|
+
end
|
metadata
ADDED
@@ -0,0 +1,160 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: raygun-apm
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.3
|
5
|
+
platform: x86-linux
|
6
|
+
authors:
|
7
|
+
- Erkki Eilonen
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-10-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: debase-ruby_core_source
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.10.6
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.10.6
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.16'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.16'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '12.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '12.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: minitest
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '5.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '5.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake-compiler
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.0.8
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 1.0.8
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake-compiler-dock
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.7.2
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.7.2
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: benchmark_driver
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 0.14.17
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 0.14.17
|
111
|
+
description:
|
112
|
+
email:
|
113
|
+
- erkki@bearmetal.eu
|
114
|
+
executables: []
|
115
|
+
extensions: []
|
116
|
+
extra_rdoc_files: []
|
117
|
+
files:
|
118
|
+
- Gemfile
|
119
|
+
- Gemfile.lock
|
120
|
+
- README.md
|
121
|
+
- bin/console
|
122
|
+
- bin/setup
|
123
|
+
- ext/raygun/extconf.rb
|
124
|
+
- lib/raygun/apm.rb
|
125
|
+
- lib/raygun/apm/blacklist.rb
|
126
|
+
- lib/raygun/apm/config.rb
|
127
|
+
- lib/raygun/apm/event.rb
|
128
|
+
- lib/raygun/apm/middleware.rb
|
129
|
+
- lib/raygun/apm/tracer.rb
|
130
|
+
- lib/raygun/apm/version.rb
|
131
|
+
- lib/raygun/raygun_ext.so
|
132
|
+
- raygun-apm.gemspec
|
133
|
+
homepage:
|
134
|
+
licenses: []
|
135
|
+
metadata: {}
|
136
|
+
post_install_message:
|
137
|
+
rdoc_options: []
|
138
|
+
require_paths:
|
139
|
+
- lib
|
140
|
+
- ext
|
141
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '2.6'
|
146
|
+
- - "<"
|
147
|
+
- !ruby/object:Gem::Version
|
148
|
+
version: 2.7.dev
|
149
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - ">="
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: '0'
|
154
|
+
requirements: []
|
155
|
+
rubyforge_project:
|
156
|
+
rubygems_version: 2.7.9
|
157
|
+
signing_key:
|
158
|
+
specification_version: 4
|
159
|
+
summary: Raygun application performance monitoring
|
160
|
+
test_files: []
|