mnemosyne-ruby 1.17.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +5 -25
- data/.rubocop.yml +1 -1
- data/Appraisals +4 -30
- data/CHANGELOG.md +11 -0
- data/Gemfile +1 -1
- data/README.md +8 -7
- data/gemfiles/core.gemfile +1 -0
- data/gemfiles/faraday_10.gemfile +1 -0
- data/gemfiles/{faraday_09.gemfile → faraday_20.gemfile} +2 -1
- data/gemfiles/rails_61.gemfile +1 -0
- data/gemfiles/rails_70.gemfile +1 -0
- data/gemfiles/rails_71.gemfile +1 -0
- data/gemfiles/redis_40.gemfile +1 -0
- data/gemfiles/redis_50.gemfile +1 -0
- data/gemfiles/sidekiq_60.gemfile +1 -0
- data/gemfiles/sidekiq_70.gemfile +1 -0
- data/lib/mnemosyne/client.rb +1 -1
- data/lib/mnemosyne/global.rb +6 -2
- data/lib/mnemosyne/instrumenter.rb +1 -1
- data/lib/mnemosyne/middleware/rack.rb +7 -5
- data/lib/mnemosyne/middleware/sidekiq.rb +7 -5
- data/lib/mnemosyne/probes/acfs/request.rb +6 -2
- data/lib/mnemosyne/probes/action_controller/process_action.rb +6 -2
- data/lib/mnemosyne/probes/action_controller/renderers.rb +6 -3
- data/lib/mnemosyne/probes/action_view/render_partial.rb +6 -2
- data/lib/mnemosyne/probes/action_view/render_template.rb +6 -2
- data/lib/mnemosyne/probes/active_job/perform.rb +6 -2
- data/lib/mnemosyne/probes/active_record/instantiation.rb +6 -2
- data/lib/mnemosyne/probes/active_record/query.rb +6 -2
- data/lib/mnemosyne/probes/faraday/base.rb +1 -10
- data/lib/mnemosyne/probes/grape/endpoint_render.rb +5 -2
- data/lib/mnemosyne/probes/grape/endpoint_run.rb +6 -2
- data/lib/mnemosyne/probes/grape/endpoint_run_filters.rb +5 -2
- data/lib/mnemosyne/probes/mnemosyne/tracer.rb +6 -2
- data/lib/mnemosyne/probes/msgr/client.rb +1 -1
- data/lib/mnemosyne/probes/msgr/consumer.rb +5 -3
- data/lib/mnemosyne/probes/responder/respond.rb +5 -2
- data/lib/mnemosyne/probes/restify/base.rb +1 -1
- data/lib/mnemosyne/probes/sidekiq/client.rb +1 -1
- data/lib/mnemosyne/probes/view_component/render_component.rb +6 -2
- data/lib/mnemosyne/span.rb +5 -5
- data/lib/mnemosyne/trace.rb +7 -7
- data/lib/mnemosyne/version.rb +2 -2
- data/mnemosyne-ruby.gemspec +2 -2
- metadata +7 -10
- data/gemfiles/rails_52.gemfile +0 -27
- data/gemfiles/rails_60.gemfile +0 -27
- data/gemfiles/sidekiq_50.gemfile +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c57253509dac7b4769c0e5849ceaff9f3a95d5d2ddd8ac3e21085fccd4b4579
|
4
|
+
data.tar.gz: e66afe82c07e5334de5d8f71c06803aea19e033e242d71b632d65a088f9d4e5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7934610efa74dfbcbd6a58c61b6266ada44babd8dbb299b724e5967598dbcbcef17159931ac40339ae79865b29e90fe8a3a00a2bc0ed3a9476ad00f594382c18
|
7
|
+
data.tar.gz: bbf9d044b365f8e1b17374808201f929719335f72e956f71f31421f47449d231603ea1eccc27e2e3104aa971418bb0e16c8c6aabd29f1404cf12d15eaafc42e0
|
data/.github/workflows/test.yml
CHANGED
@@ -12,18 +12,15 @@ jobs:
|
|
12
12
|
fail-fast: false
|
13
13
|
matrix:
|
14
14
|
ruby:
|
15
|
+
- "3.3"
|
15
16
|
- "3.2"
|
16
17
|
- "3.1"
|
17
|
-
- "3.0"
|
18
|
-
- "2.7"
|
19
18
|
suite:
|
20
19
|
- core
|
21
|
-
- faraday-0.9
|
22
20
|
- faraday-1.0
|
21
|
+
- faraday-2.0
|
23
22
|
- msgr
|
24
23
|
- rack
|
25
|
-
- rails-5.2
|
26
|
-
- rails-6.0
|
27
24
|
- rails-6.1
|
28
25
|
- rails-7.0
|
29
26
|
- rails-7.1
|
@@ -31,31 +28,24 @@ jobs:
|
|
31
28
|
- redis-5.0
|
32
29
|
- redis-client
|
33
30
|
- restify
|
34
|
-
- sidekiq-5
|
35
31
|
- sidekiq-6
|
36
32
|
- sidekiq-7
|
37
33
|
include:
|
38
34
|
- suite: core
|
39
35
|
spec: --tag ~probe
|
40
36
|
gemfile: gemfiles/core.gemfile
|
41
|
-
- suite: faraday-0.9
|
42
|
-
spec: --tag probe:faraday
|
43
|
-
gemfile: gemfiles/faraday_09.gemfile
|
44
37
|
- suite: faraday-1.0
|
45
38
|
spec: --tag probe:faraday
|
46
39
|
gemfile: gemfiles/faraday_10.gemfile
|
40
|
+
- suite: faraday-2.0
|
41
|
+
spec: --tag probe:faraday
|
42
|
+
gemfile: gemfiles/faraday_20.gemfile
|
47
43
|
- suite: msgr
|
48
44
|
spec: --tag probe:msgr
|
49
45
|
gemfile: gemfiles/core.gemfile
|
50
46
|
- suite: rack
|
51
47
|
spec: --tag probe:rack
|
52
48
|
gemfile: gemfiles/core.gemfile
|
53
|
-
- suite: rails-5.2
|
54
|
-
spec: --tag probe:rails --tag ~probe
|
55
|
-
gemfile: gemfiles/rails_52.gemfile
|
56
|
-
- suite: rails-6.0
|
57
|
-
spec: --tag probe:rails --tag ~probe
|
58
|
-
gemfile: gemfiles/rails_60.gemfile
|
59
49
|
- suite: rails-6.1
|
60
50
|
spec: --tag probe:rails --tag ~probe
|
61
51
|
gemfile: gemfiles/rails_61.gemfile
|
@@ -77,22 +67,12 @@ jobs:
|
|
77
67
|
- suite: restify
|
78
68
|
spec: --tag probe:restify
|
79
69
|
gemfile: gemfiles/core.gemfile
|
80
|
-
- suite: sidekiq-5
|
81
|
-
spec: --tag probe:sidekiq
|
82
|
-
gemfile: gemfiles/sidekiq_50.gemfile
|
83
70
|
- suite: sidekiq-6
|
84
71
|
spec: --tag probe:sidekiq
|
85
72
|
gemfile: gemfiles/sidekiq_60.gemfile
|
86
73
|
- suite: sidekiq-7
|
87
74
|
spec: --tag probe:sidekiq
|
88
75
|
gemfile: gemfiles/sidekiq_70.gemfile
|
89
|
-
exclude:
|
90
|
-
- suite: rails-5.2
|
91
|
-
ruby: '3.2'
|
92
|
-
- suite: rails-5.2
|
93
|
-
ruby: '3.1'
|
94
|
-
- suite: rails-5.2
|
95
|
-
ruby: '3.0'
|
96
76
|
|
97
77
|
env:
|
98
78
|
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
data/.rubocop.yml
CHANGED
data/Appraisals
CHANGED
@@ -4,19 +4,19 @@ appraise 'core' do
|
|
4
4
|
remove_gem 'rubocop'
|
5
5
|
end
|
6
6
|
|
7
|
-
appraise 'faraday-
|
7
|
+
appraise 'faraday-10' do
|
8
8
|
remove_gem 'rubocop'
|
9
9
|
|
10
10
|
group :test do
|
11
|
-
gem 'faraday', '~> 0
|
11
|
+
gem 'faraday', '~> 1.0'
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
-
appraise 'faraday-
|
15
|
+
appraise 'faraday-20' do
|
16
16
|
remove_gem 'rubocop'
|
17
17
|
|
18
18
|
group :test do
|
19
|
-
gem 'faraday', '~>
|
19
|
+
gem 'faraday', '~> 2.0'
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
@@ -47,24 +47,6 @@ appraise 'rails-61' do
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
-
appraise 'rails-60' do
|
51
|
-
remove_gem 'rubocop'
|
52
|
-
|
53
|
-
group :test do
|
54
|
-
gem 'rails', '~> 6.0.0'
|
55
|
-
gem 'sqlite3', '~> 1.4'
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
appraise 'rails-52' do
|
60
|
-
remove_gem 'rubocop'
|
61
|
-
|
62
|
-
group :test do
|
63
|
-
gem 'rails', '~> 5.2.0'
|
64
|
-
gem 'sqlite3', '~> 1.4'
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
50
|
appraise 'redis-40' do
|
69
51
|
remove_gem 'rubocop'
|
70
52
|
|
@@ -81,14 +63,6 @@ appraise 'redis-50' do
|
|
81
63
|
end
|
82
64
|
end
|
83
65
|
|
84
|
-
appraise 'sidekiq-50' do
|
85
|
-
remove_gem 'rubocop'
|
86
|
-
|
87
|
-
group :test do
|
88
|
-
gem 'sidekiq', '~> 5.0'
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
66
|
appraise 'sidekiq-60' do
|
93
67
|
remove_gem 'rubocop'
|
94
68
|
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
### Removed
|
10
|
+
|
11
|
+
- Dropped support for Ruby < 3.1
|
12
|
+
- Dropped support for Rails < 6.1
|
13
|
+
- Dropped support for Sidekiq < 6.0
|
14
|
+
- Dropped support for Faraday < 1.0
|
15
|
+
|
16
|
+
### Added
|
17
|
+
|
18
|
+
- Added Faraday 2.0 to test matrix
|
19
|
+
|
9
20
|
## [1.17.0] - 2023-11-28
|
10
21
|
|
11
22
|
### Added
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -6,14 +6,19 @@ Supported probes:
|
|
6
6
|
|
7
7
|
* Acfs: Remote calls including tracing middleware
|
8
8
|
* ActionController: Processing actions and rendering
|
9
|
-
*
|
9
|
+
* ActionDispatch: Error capturing
|
10
|
+
* ActiveJob: Background job execution
|
10
11
|
* ActiveRecord: SQL query time
|
12
|
+
* ActiveView: Template and Partial rendering
|
13
|
+
* Faraday: HTTP client operations and tracing injection
|
11
14
|
* Grape: Endpoint run, filter and render times
|
12
15
|
* Mnemosyne: Custom traces
|
16
|
+
* Msgr: Event publishing and consumer processing
|
17
|
+
* Rack: Middleware for request tracing
|
18
|
+
* Redis: Client operations
|
13
19
|
* Responders: render time
|
14
20
|
* Restify: Remote calls including tracing middleware
|
15
21
|
* Sidekiq: Client and server tracing
|
16
|
-
* Rack: Middleware for request tracing
|
17
22
|
* ViewComponent: Component rendering (needs [additional configuration](https://viewcomponent.org/guide/instrumentation.html))
|
18
23
|
|
19
24
|
## Installation
|
@@ -21,15 +26,11 @@ Supported probes:
|
|
21
26
|
Add this line to your Gemfile:
|
22
27
|
|
23
28
|
```ruby
|
24
|
-
gem 'mnemosyne-ruby', '~>
|
29
|
+
gem 'mnemosyne-ruby', '~> 2.0'
|
25
30
|
```
|
26
31
|
|
27
32
|
Note: Removing support for ancient Ruby or Rails versions will not result in a new major. Please be extra careful when using ancient Ruby or Rails versions and updating gems.
|
28
33
|
|
29
|
-
## Usage
|
30
|
-
|
31
|
-
TODO
|
32
|
-
|
33
34
|
## License
|
34
35
|
|
35
36
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/gemfiles/core.gemfile
CHANGED
data/gemfiles/faraday_10.gemfile
CHANGED
@@ -7,10 +7,11 @@ gem "rake", "~> 13.0"
|
|
7
7
|
group :test do
|
8
8
|
gem "rspec", "~> 3.6"
|
9
9
|
gem "timecop", "~> 0.9.1"
|
10
|
-
gem "faraday", "~> 0
|
10
|
+
gem "faraday", "~> 2.0"
|
11
11
|
gem "msgr"
|
12
12
|
gem "rails"
|
13
13
|
gem "redis"
|
14
|
+
gem "redis-client"
|
14
15
|
gem "restify"
|
15
16
|
gem "sidekiq"
|
16
17
|
gem "sqlite3"
|
data/gemfiles/rails_61.gemfile
CHANGED
data/gemfiles/rails_70.gemfile
CHANGED
data/gemfiles/rails_71.gemfile
CHANGED
data/gemfiles/redis_40.gemfile
CHANGED
data/gemfiles/redis_50.gemfile
CHANGED
data/gemfiles/sidekiq_60.gemfile
CHANGED
data/gemfiles/sidekiq_70.gemfile
CHANGED
data/lib/mnemosyne/client.rb
CHANGED
data/lib/mnemosyne/global.rb
CHANGED
@@ -3,8 +3,12 @@
|
|
3
3
|
module Mnemosyne
|
4
4
|
module Global
|
5
5
|
def trace(name, meta: {}, &block)
|
6
|
-
::ActiveSupport::Notifications.instrument
|
7
|
-
|
6
|
+
::ActiveSupport::Notifications.instrument(
|
7
|
+
'trace.mnemosyne',
|
8
|
+
name:,
|
9
|
+
meta:,
|
10
|
+
&block
|
11
|
+
)
|
8
12
|
end
|
9
13
|
|
10
14
|
def attach_error(err)
|
@@ -16,9 +16,9 @@ module Mnemosyne
|
|
16
16
|
@body.respond_to?(*args)
|
17
17
|
end
|
18
18
|
|
19
|
-
def method_missing(*args, &
|
19
|
+
def method_missing(*args, &)
|
20
20
|
super if args.first && args.first.to_s == 'to_ary'
|
21
|
-
@body.__send__(*args, &
|
21
|
+
@body.__send__(*args, &)
|
22
22
|
end
|
23
23
|
|
24
24
|
def close
|
@@ -64,9 +64,11 @@ module Mnemosyne
|
|
64
64
|
::SecureRandom.uuid
|
65
65
|
end
|
66
66
|
|
67
|
-
trace = ::Mnemosyne::Instrumenter.trace
|
68
|
-
|
69
|
-
|
67
|
+
trace = ::Mnemosyne::Instrumenter.trace(
|
68
|
+
'app.web.request.rack',
|
69
|
+
transaction:,
|
70
|
+
origin:
|
71
|
+
)
|
70
72
|
|
71
73
|
if trace
|
72
74
|
trace.start!
|
@@ -9,15 +9,17 @@ module Mnemosyne
|
|
9
9
|
|
10
10
|
meta = {
|
11
11
|
raw: job,
|
12
|
-
queue
|
12
|
+
queue:,
|
13
13
|
worker: worker.class.name,
|
14
14
|
arguments: job['args']
|
15
15
|
}
|
16
16
|
|
17
|
-
trace = ::Mnemosyne::Instrumenter.trace
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
trace = ::Mnemosyne::Instrumenter.trace(
|
18
|
+
'app.job.perform.sidekiq',
|
19
|
+
transaction:,
|
20
|
+
origin:,
|
21
|
+
meta:
|
22
|
+
)
|
21
23
|
|
22
24
|
trace&.start!
|
23
25
|
|
@@ -25,8 +25,12 @@ module Mnemosyne
|
|
25
25
|
backtrace: callers[1..]
|
26
26
|
}
|
27
27
|
|
28
|
-
span = ::Mnemosyne::Span.new
|
29
|
-
|
28
|
+
span = ::Mnemosyne::Span.new(
|
29
|
+
'external.run.acfs',
|
30
|
+
start:,
|
31
|
+
finish:,
|
32
|
+
meta:
|
33
|
+
)
|
30
34
|
|
31
35
|
trace << span
|
32
36
|
end
|
@@ -17,8 +17,12 @@ module Mnemosyne
|
|
17
17
|
format: payload[:format]
|
18
18
|
}
|
19
19
|
|
20
|
-
span = ::Mnemosyne::Span.new
|
21
|
-
|
20
|
+
span = ::Mnemosyne::Span.new(
|
21
|
+
'app.controller.request.rails',
|
22
|
+
start:,
|
23
|
+
finish:,
|
24
|
+
meta:
|
25
|
+
)
|
22
26
|
|
23
27
|
trace << span
|
24
28
|
end
|
@@ -17,15 +17,18 @@ module Mnemosyne
|
|
17
17
|
start = ::Mnemosyne::Clock.to_tick(start)
|
18
18
|
finish = ::Mnemosyne::Clock.to_tick(finish)
|
19
19
|
|
20
|
-
span = ::Mnemosyne::Span.new
|
21
|
-
|
20
|
+
span = ::Mnemosyne::Span.new(
|
21
|
+
'app.controller.renderers.rails',
|
22
|
+
start:,
|
23
|
+
finish:
|
24
|
+
)
|
22
25
|
|
23
26
|
trace << span
|
24
27
|
end
|
25
28
|
end
|
26
29
|
|
27
30
|
module Instrumentation
|
28
|
-
def render_to_body(*args, &
|
31
|
+
def render_to_body(*args, &)
|
29
32
|
::ActiveSupport::Notifications.instrument CATEGORY do
|
30
33
|
super
|
31
34
|
end
|
@@ -11,8 +11,12 @@ module Mnemosyne
|
|
11
11
|
start = ::Mnemosyne::Clock.to_tick(start)
|
12
12
|
finish = ::Mnemosyne::Clock.to_tick(finish)
|
13
13
|
|
14
|
-
span = ::Mnemosyne::Span.new
|
15
|
-
|
14
|
+
span = ::Mnemosyne::Span.new(
|
15
|
+
'view.render.template.rails',
|
16
|
+
start:,
|
17
|
+
finish:,
|
18
|
+
meta: payload
|
19
|
+
)
|
16
20
|
|
17
21
|
trace << span
|
18
22
|
end
|
@@ -11,8 +11,12 @@ module Mnemosyne
|
|
11
11
|
start = ::Mnemosyne::Clock.to_tick(start)
|
12
12
|
finish = ::Mnemosyne::Clock.to_tick(finish)
|
13
13
|
|
14
|
-
span = ::Mnemosyne::Span.new
|
15
|
-
|
14
|
+
span = ::Mnemosyne::Span.new(
|
15
|
+
'view.render.template.rails',
|
16
|
+
start:,
|
17
|
+
finish:,
|
18
|
+
meta: payload
|
19
|
+
)
|
16
20
|
|
17
21
|
trace << span
|
18
22
|
end
|
@@ -20,8 +20,12 @@ module Mnemosyne
|
|
20
20
|
queue: job.queue_name
|
21
21
|
}
|
22
22
|
|
23
|
-
span = ::Mnemosyne::Span.new
|
24
|
-
|
23
|
+
span = ::Mnemosyne::Span.new(
|
24
|
+
'app.job.perform.active_job',
|
25
|
+
start:,
|
26
|
+
finish:,
|
27
|
+
meta:
|
28
|
+
)
|
25
29
|
|
26
30
|
trace << span
|
27
31
|
end
|
@@ -16,8 +16,12 @@ module Mnemosyne
|
|
16
16
|
class_name: payload[:class_name]
|
17
17
|
}
|
18
18
|
|
19
|
-
span = ::Mnemosyne::Span.new
|
20
|
-
|
19
|
+
span = ::Mnemosyne::Span.new(
|
20
|
+
'db.instantiation.active_record',
|
21
|
+
start:,
|
22
|
+
finish:,
|
23
|
+
meta:
|
24
|
+
)
|
21
25
|
|
22
26
|
trace << span
|
23
27
|
end
|
@@ -18,8 +18,12 @@ module Mnemosyne
|
|
18
18
|
binds: extract_bind_values(payload)
|
19
19
|
}
|
20
20
|
|
21
|
-
span = ::Mnemosyne::Span.new
|
22
|
-
|
21
|
+
span = ::Mnemosyne::Span.new(
|
22
|
+
'db.query.active_record',
|
23
|
+
start:,
|
24
|
+
finish:,
|
25
|
+
meta:
|
26
|
+
)
|
23
27
|
|
24
28
|
trace << span
|
25
29
|
end
|
@@ -17,16 +17,7 @@ module Mnemosyne
|
|
17
17
|
|
18
18
|
module Extension
|
19
19
|
def lock!
|
20
|
-
unless @handlers.include?('Mnemosyne::Middleware::Faraday')
|
21
|
-
if ::Faraday::VERSION < '1.0' &&
|
22
|
-
respond_to?(:is_adapter?, true) &&
|
23
|
-
(idx = @handlers.find_index {|m| is_adapter?(m) })
|
24
|
-
|
25
|
-
insert(idx, ::Mnemosyne::Middleware::Faraday)
|
26
|
-
else
|
27
|
-
use(::Mnemosyne::Middleware::Faraday)
|
28
|
-
end
|
29
|
-
end
|
20
|
+
use(::Mnemosyne::Middleware::Faraday) unless @handlers.include?('Mnemosyne::Middleware::Faraday')
|
30
21
|
|
31
22
|
super
|
32
23
|
end
|
@@ -14,8 +14,11 @@ module Mnemosyne
|
|
14
14
|
endpoint = payload[:endpoint]
|
15
15
|
return unless endpoint
|
16
16
|
|
17
|
-
span = ::Mnemosyne::Span.new
|
18
|
-
|
17
|
+
span = ::Mnemosyne::Span.new(
|
18
|
+
'view.render.grape',
|
19
|
+
start:,
|
20
|
+
finish:
|
21
|
+
)
|
19
22
|
|
20
23
|
trace << span
|
21
24
|
end
|
@@ -19,8 +19,12 @@ module Mnemosyne
|
|
19
19
|
format: extract_format(payload[:env])
|
20
20
|
}
|
21
21
|
|
22
|
-
span = ::Mnemosyne::Span.new
|
23
|
-
|
22
|
+
span = ::Mnemosyne::Span.new(
|
23
|
+
'app.controller.request.grape',
|
24
|
+
start:,
|
25
|
+
finish:,
|
26
|
+
meta:
|
27
|
+
)
|
24
28
|
|
25
29
|
trace << span
|
26
30
|
end
|
@@ -14,8 +14,11 @@ module Mnemosyne
|
|
14
14
|
endpoint = payload[:endpoint]
|
15
15
|
return unless endpoint
|
16
16
|
|
17
|
-
span = ::Mnemosyne::Span.new
|
18
|
-
|
17
|
+
span = ::Mnemosyne::Span.new(
|
18
|
+
'app.controller.filter.grape',
|
19
|
+
start:,
|
20
|
+
finish:
|
21
|
+
)
|
19
22
|
|
20
23
|
trace << span
|
21
24
|
end
|
@@ -11,8 +11,12 @@ module Mnemosyne
|
|
11
11
|
start = ::Mnemosyne::Clock.to_tick(start)
|
12
12
|
finish = ::Mnemosyne::Clock.to_tick(finish)
|
13
13
|
|
14
|
-
span = ::Mnemosyne::Span.new
|
15
|
-
|
14
|
+
span = ::Mnemosyne::Span.new(
|
15
|
+
'custom.trace',
|
16
|
+
start:,
|
17
|
+
finish:,
|
18
|
+
meta: payload
|
19
|
+
)
|
16
20
|
|
17
21
|
trace << span
|
18
22
|
end
|
@@ -16,7 +16,7 @@ module Mnemosyne
|
|
16
16
|
def publish(payload, options = {})
|
17
17
|
if (trace = ::Mnemosyne::Instrumenter.current_trace)
|
18
18
|
meta = {}
|
19
|
-
span = ::Mnemosyne::Span.new(NAME, meta:
|
19
|
+
span = ::Mnemosyne::Span.new(NAME, meta:)
|
20
20
|
span.start!
|
21
21
|
|
22
22
|
options[:headers] ||= {}
|
@@ -24,9 +24,11 @@ module Mnemosyne
|
|
24
24
|
::SecureRandom.uuid
|
25
25
|
end
|
26
26
|
|
27
|
-
trace = ::Mnemosyne::Instrumenter.trace
|
28
|
-
|
29
|
-
|
27
|
+
trace = ::Mnemosyne::Instrumenter.trace(
|
28
|
+
NAME,
|
29
|
+
transaction:,
|
30
|
+
origin:
|
31
|
+
)
|
30
32
|
|
31
33
|
if trace
|
32
34
|
trace.meta[:properties] = {
|
@@ -16,8 +16,11 @@ module Mnemosyne
|
|
16
16
|
start = ::Mnemosyne::Clock.to_tick(start)
|
17
17
|
finish = ::Mnemosyne::Clock.to_tick(finish)
|
18
18
|
|
19
|
-
span = ::Mnemosyne::Span.new
|
20
|
-
|
19
|
+
span = ::Mnemosyne::Span.new(
|
20
|
+
'app.responder.respond',
|
21
|
+
start:,
|
22
|
+
finish:
|
23
|
+
)
|
21
24
|
|
22
25
|
trace << span
|
23
26
|
end
|
@@ -13,7 +13,7 @@ module Mnemosyne
|
|
13
13
|
def call(request)
|
14
14
|
if (trace = ::Mnemosyne::Instrumenter.current_trace)
|
15
15
|
meta = {url: request.uri.to_s, method: request.method}
|
16
|
-
span = ::Mnemosyne::Span.new
|
16
|
+
span = ::Mnemosyne::Span.new('external.http.restify', meta:)
|
17
17
|
|
18
18
|
span.start!
|
19
19
|
|
@@ -11,8 +11,12 @@ module Mnemosyne
|
|
11
11
|
start = ::Mnemosyne::Clock.to_tick(start)
|
12
12
|
finish = ::Mnemosyne::Clock.to_tick(finish)
|
13
13
|
|
14
|
-
span = ::Mnemosyne::Span.new
|
15
|
-
|
14
|
+
span = ::Mnemosyne::Span.new(
|
15
|
+
'view.render.component.view_component',
|
16
|
+
start:,
|
17
|
+
finish:,
|
18
|
+
meta: payload
|
19
|
+
)
|
16
20
|
|
17
21
|
trace << span
|
18
22
|
end
|
data/lib/mnemosyne/span.rb
CHANGED
data/lib/mnemosyne/trace.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Mnemosyne
|
4
4
|
class Trace < Span
|
5
|
-
BT_REGEXP = /^((?:[a-zA-Z]:)?[^:]+):(\d+)(?::in `([^']+)')
|
5
|
+
BT_REGEXP = /^((?:[a-zA-Z]:)?[^:]+):(\d+)(?::in `([^']+)')?$/
|
6
6
|
|
7
7
|
attr_reader :uuid, :transaction, :origin, :span, :errors
|
8
8
|
|
@@ -46,13 +46,13 @@ module Mnemosyne
|
|
46
46
|
|
47
47
|
def serialize
|
48
48
|
{
|
49
|
-
uuid
|
50
|
-
origin
|
51
|
-
transaction
|
52
|
-
name
|
53
|
-
start
|
49
|
+
uuid:,
|
50
|
+
origin:,
|
51
|
+
transaction:,
|
52
|
+
name:,
|
53
|
+
start:,
|
54
54
|
stop: finish,
|
55
|
-
meta
|
55
|
+
meta:,
|
56
56
|
span: @span.map(&:serialize),
|
57
57
|
errors: @errors.map(&:serialize)
|
58
58
|
}
|
data/lib/mnemosyne/version.rb
CHANGED
data/mnemosyne-ruby.gemspec
CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.executables = spec.files.grep(%r{^bin/}) {|f| File.basename(f) }
|
27
27
|
spec.require_paths = %w[lib]
|
28
28
|
|
29
|
-
spec.required_ruby_version = '>=
|
30
|
-
spec.add_runtime_dependency 'activesupport', '>=
|
29
|
+
spec.required_ruby_version = '>= 3.1'
|
30
|
+
spec.add_runtime_dependency 'activesupport', '>= 6.1'
|
31
31
|
spec.add_runtime_dependency 'bunny'
|
32
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mnemosyne-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Graichen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '6.1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '6.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bunny
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -59,16 +59,13 @@ files:
|
|
59
59
|
- README.md
|
60
60
|
- Rakefile
|
61
61
|
- gemfiles/core.gemfile
|
62
|
-
- gemfiles/faraday_09.gemfile
|
63
62
|
- gemfiles/faraday_10.gemfile
|
64
|
-
- gemfiles/
|
65
|
-
- gemfiles/rails_60.gemfile
|
63
|
+
- gemfiles/faraday_20.gemfile
|
66
64
|
- gemfiles/rails_61.gemfile
|
67
65
|
- gemfiles/rails_70.gemfile
|
68
66
|
- gemfiles/rails_71.gemfile
|
69
67
|
- gemfiles/redis_40.gemfile
|
70
68
|
- gemfiles/redis_50.gemfile
|
71
|
-
- gemfiles/sidekiq_50.gemfile
|
72
69
|
- gemfiles/sidekiq_60.gemfile
|
73
70
|
- gemfiles/sidekiq_70.gemfile
|
74
71
|
- lib/mnemosyne-ruby.rb
|
@@ -131,14 +128,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
131
128
|
requirements:
|
132
129
|
- - ">="
|
133
130
|
- !ruby/object:Gem::Version
|
134
|
-
version: '
|
131
|
+
version: '3.1'
|
135
132
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
136
133
|
requirements:
|
137
134
|
- - ">="
|
138
135
|
- !ruby/object:Gem::Version
|
139
136
|
version: '0'
|
140
137
|
requirements: []
|
141
|
-
rubygems_version: 3.
|
138
|
+
rubygems_version: 3.5.3
|
142
139
|
signing_key:
|
143
140
|
specification_version: 4
|
144
141
|
summary: Ruby/Rails client for Mnemosyne APM
|
data/gemfiles/rails_52.gemfile
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
gem "rake", "~> 13.0"
|
6
|
-
|
7
|
-
group :test do
|
8
|
-
gem "rspec", "~> 3.6"
|
9
|
-
gem "timecop", "~> 0.9.1"
|
10
|
-
gem "faraday"
|
11
|
-
gem "msgr"
|
12
|
-
gem "rails", "~> 5.2.0"
|
13
|
-
gem "redis"
|
14
|
-
gem "restify"
|
15
|
-
gem "sidekiq"
|
16
|
-
gem "sqlite3", "~> 1.4"
|
17
|
-
gem "webmock"
|
18
|
-
end
|
19
|
-
|
20
|
-
group :development do
|
21
|
-
gem "appraisal"
|
22
|
-
gem "rake-release", "~> 1.3.0"
|
23
|
-
gem "pry", require: false
|
24
|
-
gem "pry-byebug", require: false
|
25
|
-
end
|
26
|
-
|
27
|
-
gemspec path: "../"
|
data/gemfiles/rails_60.gemfile
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
gem "rake", "~> 13.0"
|
6
|
-
|
7
|
-
group :test do
|
8
|
-
gem "rspec", "~> 3.6"
|
9
|
-
gem "timecop", "~> 0.9.1"
|
10
|
-
gem "faraday"
|
11
|
-
gem "msgr"
|
12
|
-
gem "rails", "~> 6.0.0"
|
13
|
-
gem "redis"
|
14
|
-
gem "restify"
|
15
|
-
gem "sidekiq"
|
16
|
-
gem "sqlite3", "~> 1.4"
|
17
|
-
gem "webmock"
|
18
|
-
end
|
19
|
-
|
20
|
-
group :development do
|
21
|
-
gem "appraisal"
|
22
|
-
gem "rake-release", "~> 1.3.0"
|
23
|
-
gem "pry", require: false
|
24
|
-
gem "pry-byebug", require: false
|
25
|
-
end
|
26
|
-
|
27
|
-
gemspec path: "../"
|
data/gemfiles/sidekiq_50.gemfile
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
gem "rake", "~> 13.0"
|
6
|
-
|
7
|
-
group :test do
|
8
|
-
gem "rspec", "~> 3.6"
|
9
|
-
gem "timecop", "~> 0.9.1"
|
10
|
-
gem "faraday"
|
11
|
-
gem "msgr"
|
12
|
-
gem "rails"
|
13
|
-
gem "redis"
|
14
|
-
gem "restify"
|
15
|
-
gem "sidekiq", "~> 5.0"
|
16
|
-
gem "sqlite3"
|
17
|
-
gem "webmock"
|
18
|
-
end
|
19
|
-
|
20
|
-
group :development do
|
21
|
-
gem "appraisal"
|
22
|
-
gem "rake-release", "~> 1.3.0"
|
23
|
-
gem "pry", require: false
|
24
|
-
gem "pry-byebug", require: false
|
25
|
-
end
|
26
|
-
|
27
|
-
gemspec path: "../"
|