mnemosyne-ruby 1.16.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 +29 -25
- data/.rubocop.yml +1 -1
- data/Appraisals +8 -25
- data/CHANGELOG.md +23 -1
- 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_52.gemfile → rails_71.gemfile} +2 -1
- 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_dispatch/show_exceptions.rb +6 -1
- 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 +8 -11
- data/.github/workflows/lint.yml +0 -25
- 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,55 +12,49 @@ 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
|
26
|
+
- rails-7.1
|
29
27
|
- redis-4.0
|
30
28
|
- redis-5.0
|
31
29
|
- redis-client
|
32
30
|
- restify
|
33
|
-
- sidekiq-5
|
34
31
|
- sidekiq-6
|
35
32
|
- sidekiq-7
|
36
33
|
include:
|
37
34
|
- suite: core
|
38
35
|
spec: --tag ~probe
|
39
36
|
gemfile: gemfiles/core.gemfile
|
40
|
-
- suite: faraday-0.9
|
41
|
-
spec: --tag probe:faraday
|
42
|
-
gemfile: gemfiles/faraday_09.gemfile
|
43
37
|
- suite: faraday-1.0
|
44
38
|
spec: --tag probe:faraday
|
45
39
|
gemfile: gemfiles/faraday_10.gemfile
|
40
|
+
- suite: faraday-2.0
|
41
|
+
spec: --tag probe:faraday
|
42
|
+
gemfile: gemfiles/faraday_20.gemfile
|
46
43
|
- suite: msgr
|
47
44
|
spec: --tag probe:msgr
|
48
45
|
gemfile: gemfiles/core.gemfile
|
49
46
|
- suite: rack
|
50
47
|
spec: --tag probe:rack
|
51
48
|
gemfile: gemfiles/core.gemfile
|
52
|
-
- suite: rails-5.2
|
53
|
-
spec: --tag probe:rails --tag ~probe
|
54
|
-
gemfile: gemfiles/rails_52.gemfile
|
55
|
-
- suite: rails-6.0
|
56
|
-
spec: --tag probe:rails --tag ~probe
|
57
|
-
gemfile: gemfiles/rails_60.gemfile
|
58
49
|
- suite: rails-6.1
|
59
50
|
spec: --tag probe:rails --tag ~probe
|
60
51
|
gemfile: gemfiles/rails_61.gemfile
|
61
52
|
- suite: rails-7.0
|
62
53
|
spec: --tag probe:rails --tag ~probe
|
63
54
|
gemfile: gemfiles/rails_70.gemfile
|
55
|
+
- suite: rails-7.1
|
56
|
+
spec: --tag probe:rails --tag ~probe
|
57
|
+
gemfile: gemfiles/rails_71.gemfile
|
64
58
|
- suite: redis-4.0
|
65
59
|
spec: --tag probe:redis
|
66
60
|
gemfile: gemfiles/redis_40.gemfile
|
@@ -73,22 +67,12 @@ jobs:
|
|
73
67
|
- suite: restify
|
74
68
|
spec: --tag probe:restify
|
75
69
|
gemfile: gemfiles/core.gemfile
|
76
|
-
- suite: sidekiq-5
|
77
|
-
spec: --tag probe:sidekiq
|
78
|
-
gemfile: gemfiles/sidekiq_50.gemfile
|
79
70
|
- suite: sidekiq-6
|
80
71
|
spec: --tag probe:sidekiq
|
81
72
|
gemfile: gemfiles/sidekiq_60.gemfile
|
82
73
|
- suite: sidekiq-7
|
83
74
|
spec: --tag probe:sidekiq
|
84
75
|
gemfile: gemfiles/sidekiq_70.gemfile
|
85
|
-
exclude:
|
86
|
-
- suite: rails-5.2
|
87
|
-
ruby: '3.2'
|
88
|
-
- suite: rails-5.2
|
89
|
-
ruby: '3.1'
|
90
|
-
- suite: rails-5.2
|
91
|
-
ruby: '3.0'
|
92
76
|
|
93
77
|
env:
|
94
78
|
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
@@ -118,3 +102,23 @@ jobs:
|
|
118
102
|
env:
|
119
103
|
AMQP_SERVER: amqp://localhost:${{ job.services.rabbitmq.ports[5672] }}
|
120
104
|
run: bundle exec rspec --color ${{ matrix.spec }}
|
105
|
+
|
106
|
+
rubocop:
|
107
|
+
name: rubocop
|
108
|
+
runs-on: ubuntu-22.04
|
109
|
+
|
110
|
+
env:
|
111
|
+
BUNDLE_WITHOUT: development test
|
112
|
+
|
113
|
+
steps:
|
114
|
+
- uses: actions/checkout@master
|
115
|
+
- uses: ruby/setup-ruby@v1
|
116
|
+
env:
|
117
|
+
BUNDLE_JOBS: 4
|
118
|
+
BUNDLE_RETRY: 3
|
119
|
+
with:
|
120
|
+
ruby-version: 3.1
|
121
|
+
bundler-cache: true
|
122
|
+
|
123
|
+
- name: Run rubocop
|
124
|
+
run: bundle exec rubocop --parallel --color
|
data/.rubocop.yml
CHANGED
data/Appraisals
CHANGED
@@ -4,14 +4,6 @@ appraise 'core' do
|
|
4
4
|
remove_gem 'rubocop'
|
5
5
|
end
|
6
6
|
|
7
|
-
appraise 'faraday-09' do
|
8
|
-
remove_gem 'rubocop'
|
9
|
-
|
10
|
-
group :test do
|
11
|
-
gem 'faraday', '~> 0.9'
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
7
|
appraise 'faraday-10' do
|
16
8
|
remove_gem 'rubocop'
|
17
9
|
|
@@ -20,38 +12,37 @@ appraise 'faraday-10' do
|
|
20
12
|
end
|
21
13
|
end
|
22
14
|
|
23
|
-
appraise '
|
15
|
+
appraise 'faraday-20' do
|
24
16
|
remove_gem 'rubocop'
|
25
17
|
|
26
18
|
group :test do
|
27
|
-
gem '
|
28
|
-
gem 'sqlite3', '~> 1.4'
|
19
|
+
gem 'faraday', '~> 2.0'
|
29
20
|
end
|
30
21
|
end
|
31
22
|
|
32
|
-
appraise 'rails-
|
23
|
+
appraise 'rails-71' do
|
33
24
|
remove_gem 'rubocop'
|
34
25
|
|
35
26
|
group :test do
|
36
|
-
gem 'rails', '~>
|
27
|
+
gem 'rails', '~> 7.1.0'
|
37
28
|
gem 'sqlite3', '~> 1.4'
|
38
29
|
end
|
39
30
|
end
|
40
31
|
|
41
|
-
appraise 'rails-
|
32
|
+
appraise 'rails-70' do
|
42
33
|
remove_gem 'rubocop'
|
43
34
|
|
44
35
|
group :test do
|
45
|
-
gem 'rails', '~>
|
36
|
+
gem 'rails', '~> 7.0.0'
|
46
37
|
gem 'sqlite3', '~> 1.4'
|
47
38
|
end
|
48
39
|
end
|
49
40
|
|
50
|
-
appraise 'rails-
|
41
|
+
appraise 'rails-61' do
|
51
42
|
remove_gem 'rubocop'
|
52
43
|
|
53
44
|
group :test do
|
54
|
-
gem 'rails', '~>
|
45
|
+
gem 'rails', '~> 6.1.0'
|
55
46
|
gem 'sqlite3', '~> 1.4'
|
56
47
|
end
|
57
48
|
end
|
@@ -72,14 +63,6 @@ appraise 'redis-50' do
|
|
72
63
|
end
|
73
64
|
end
|
74
65
|
|
75
|
-
appraise 'sidekiq-50' do
|
76
|
-
remove_gem 'rubocop'
|
77
|
-
|
78
|
-
group :test do
|
79
|
-
gem 'sidekiq', '~> 5.0'
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
66
|
appraise 'sidekiq-60' do
|
84
67
|
remove_gem 'rubocop'
|
85
68
|
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,27 @@ 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
|
+
|
20
|
+
## [1.17.0] - 2023-11-28
|
21
|
+
|
22
|
+
### Added
|
23
|
+
|
24
|
+
- Add testing for Rails 7.1 by @MrSerth
|
25
|
+
|
26
|
+
### Fixed
|
27
|
+
|
28
|
+
- Invalid exception class for ActionDispatch::ExceptionWrapper by @jgraichen
|
29
|
+
|
9
30
|
## [1.16.0] - 2023-08-24
|
10
31
|
|
11
32
|
### Added
|
@@ -202,7 +223,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
202
223
|
|
203
224
|
- Add platform identifier
|
204
225
|
|
205
|
-
[Unreleased]: https://github.com/mnemosyne-mon/mnemosyne-ruby/compare/v1.
|
226
|
+
[Unreleased]: https://github.com/mnemosyne-mon/mnemosyne-ruby/compare/v1.17.0...HEAD
|
227
|
+
[1.17.0]: https://github.com/mnemosyne-mon/mnemosyne-ruby/compare/v1.16.0...v1.17.0
|
206
228
|
[1.16.0]: https://github.com/mnemosyne-mon/mnemosyne-ruby/compare/v1.15.0...v1.16.0
|
207
229
|
[1.15.0]: https://github.com/mnemosyne-mon/mnemosyne-ruby/compare/v1.14.0...v1.15.0
|
208
230
|
[1.14.0]: https://github.com/mnemosyne-mon/mnemosyne-ruby/compare/v1.14.0...v1.13.0
|
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/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
|
@@ -12,7 +12,12 @@ module Mnemosyne
|
|
12
12
|
module Instrumentation
|
13
13
|
def render_exception(env, exception)
|
14
14
|
if (trace = ::Mnemosyne::Instrumenter.current_trace)
|
15
|
-
|
15
|
+
if exception.respond_to?(:unwrapped_exception) && exception.respond_to?(:exception)
|
16
|
+
# ActionDispatch::ExceptionWrapper
|
17
|
+
trace.attach_error(exception.exception)
|
18
|
+
else
|
19
|
+
trace.attach_error(exception)
|
20
|
+
end
|
16
21
|
end
|
17
22
|
|
18
23
|
super
|
@@ -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
|
@@ -46,7 +46,6 @@ extensions: []
|
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
48
|
- ".editorconfig"
|
49
|
-
- ".github/workflows/lint.yml"
|
50
49
|
- ".github/workflows/test.yml"
|
51
50
|
- ".gitignore"
|
52
51
|
- ".markdownlint.yml"
|
@@ -60,15 +59,13 @@ files:
|
|
60
59
|
- README.md
|
61
60
|
- Rakefile
|
62
61
|
- gemfiles/core.gemfile
|
63
|
-
- gemfiles/faraday_09.gemfile
|
64
62
|
- gemfiles/faraday_10.gemfile
|
65
|
-
- gemfiles/
|
66
|
-
- gemfiles/rails_60.gemfile
|
63
|
+
- gemfiles/faraday_20.gemfile
|
67
64
|
- gemfiles/rails_61.gemfile
|
68
65
|
- gemfiles/rails_70.gemfile
|
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/.github/workflows/lint.yml
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
name: Lint
|
2
|
-
on:
|
3
|
-
- pull_request
|
4
|
-
- push
|
5
|
-
|
6
|
-
jobs:
|
7
|
-
rubocop:
|
8
|
-
name: rubocop
|
9
|
-
runs-on: ubuntu-22.04
|
10
|
-
|
11
|
-
env:
|
12
|
-
BUNDLE_WITHOUT: development test
|
13
|
-
|
14
|
-
steps:
|
15
|
-
- uses: actions/checkout@master
|
16
|
-
- uses: ruby/setup-ruby@v1
|
17
|
-
env:
|
18
|
-
BUNDLE_JOBS: 4
|
19
|
-
BUNDLE_RETRY: 3
|
20
|
-
with:
|
21
|
-
ruby-version: 3.1
|
22
|
-
bundler-cache: true
|
23
|
-
|
24
|
-
- name: Run rubocop
|
25
|
-
run: bundle exec rubocop --parallel --color
|
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: "../"
|