mnemosyne-ruby 1.7.1 → 1.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.editorconfig +8 -0
- data/.github/workflows/build.yml +93 -0
- data/.github/workflows/lint.yml +25 -0
- data/.rubocop.yml +37 -26
- data/.travis.yml +28 -26
- data/Appraisals +20 -11
- data/CHANGELOG.md +24 -1
- data/Gemfile +18 -11
- data/README.md +2 -0
- data/Rakefile +7 -3
- data/gemfiles/rails_50.gemfile +19 -12
- data/gemfiles/rails_51.gemfile +19 -12
- data/gemfiles/rails_52.gemfile +19 -12
- data/gemfiles/rails_60.gemfile +27 -0
- data/lib/mnemosyne/configuration.rb +2 -2
- data/lib/mnemosyne/global.rb +1 -1
- data/lib/mnemosyne/instrumenter.rb +8 -5
- data/lib/mnemosyne/middleware/faraday.rb +2 -2
- data/lib/mnemosyne/middleware/rack.rb +21 -13
- data/lib/mnemosyne/middleware/sidekiq.rb +3 -3
- data/lib/mnemosyne/probes.rb +1 -1
- data/lib/mnemosyne/probes/action_controller/renderers.rb +1 -1
- data/lib/mnemosyne/probes/action_dispatch/show_exceptions.rb +1 -1
- data/lib/mnemosyne/probes/faraday/base.rb +5 -3
- data/lib/mnemosyne/probes/grape/endpoint_run.rb +1 -1
- data/lib/mnemosyne/probes/msgr/client.rb +2 -2
- data/lib/mnemosyne/probes/msgr/consumer.rb +4 -4
- data/lib/mnemosyne/probes/responder/respond.rb +0 -1
- data/lib/mnemosyne/railtie.rb +1 -1
- data/lib/mnemosyne/registry.rb +1 -0
- data/lib/mnemosyne/trace.rb +6 -1
- data/lib/mnemosyne/version.rb +2 -2
- metadata +7 -4
- data/gemfiles/rails_42.gemfile +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d21523f741fef0a9443c7c93e81f220183ffd1cf19f7cdd985d69c76dee0ec51
|
4
|
+
data.tar.gz: ab0c1a21e65bf42ad5bb9eb92539421246643ec195257ca95a5024aa6217589b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af9d3e285a017330119b9ced137fb3cf4c0059789359620170df6e4a26897036dda5ff787ee5d77d6e6960a77fc6b86443215d46f14def921ba7cbd737edc410
|
7
|
+
data.tar.gz: 9a36770c25abbdeb8c3ddb38a0fb4424228065fd3c58c364aa52538d0ddf5ca5ead683da36a18604ee71ff08880a9a65c461b536cddeb914d370c03655a34b73
|
data/.editorconfig
ADDED
@@ -0,0 +1,93 @@
|
|
1
|
+
name: Build
|
2
|
+
on:
|
3
|
+
push:
|
4
|
+
branches-ignore: [debian]
|
5
|
+
|
6
|
+
jobs:
|
7
|
+
test:
|
8
|
+
name: Ruby ${{ matrix.ruby }} / ${{ matrix.suite }}
|
9
|
+
runs-on: ubuntu-18.04
|
10
|
+
|
11
|
+
strategy:
|
12
|
+
fail-fast: false
|
13
|
+
matrix:
|
14
|
+
ruby: ['2.7', '2.6', '2.5']
|
15
|
+
suite:
|
16
|
+
- core
|
17
|
+
- faraday-0.9
|
18
|
+
- faraday-1.0
|
19
|
+
- msgr
|
20
|
+
- rack
|
21
|
+
- rails-5.0
|
22
|
+
- rails-5.1
|
23
|
+
- rails-5.2
|
24
|
+
- rails-6.0
|
25
|
+
- restify
|
26
|
+
- sidekiq-5
|
27
|
+
- sidekiq-6
|
28
|
+
include:
|
29
|
+
- suite: core
|
30
|
+
spec: --tag ~probe
|
31
|
+
- suite: faraday-0.9
|
32
|
+
spec: --tag probe:faraday
|
33
|
+
env: FARADAY_VERSION='~> 0.9'
|
34
|
+
- suite: faraday-1.0
|
35
|
+
spec: --tag probe:faraday
|
36
|
+
env: FARADAY_VERSION='~> 1.0'
|
37
|
+
- suite: msgr
|
38
|
+
spec: --tag probe:msgr
|
39
|
+
- suite: rack
|
40
|
+
spec: --tag probe:rack
|
41
|
+
- suite: rails-5.0
|
42
|
+
spec: --tag probe:rails --tag ~probe
|
43
|
+
env: BUNDLE_GEMFILE=gemfiles/rails_50.gemfile
|
44
|
+
- suite: rails-5.1
|
45
|
+
spec: --tag probe:rails --tag ~probe
|
46
|
+
env: BUNDLE_GEMFILE=gemfiles/rails_51.gemfile
|
47
|
+
- suite: rails-5.2
|
48
|
+
spec: --tag probe:rails --tag ~probe
|
49
|
+
env: BUNDLE_GEMFILE=gemfiles/rails_52.gemfile
|
50
|
+
- suite: rails-6.0
|
51
|
+
spec: --tag probe:rails --tag ~probe
|
52
|
+
env: BUNDLE_GEMFILE=gemfiles/rails_60.gemfile
|
53
|
+
- suite: restify
|
54
|
+
spec: --tag probe:restify
|
55
|
+
- suite: sidekiq-5
|
56
|
+
spec: --tag probe:sidekiq
|
57
|
+
env: SIDEKIQ_VERSION='~> 5.0'
|
58
|
+
- suite: sidekiq-6
|
59
|
+
spec: --tag probe:sidekiq
|
60
|
+
env: SIDEKIQ_VERSION='~> 6.0'
|
61
|
+
|
62
|
+
|
63
|
+
services:
|
64
|
+
rabbitmq:
|
65
|
+
image: rabbitmq:latest
|
66
|
+
ports: [5672/tcp]
|
67
|
+
options: --health-cmd "rabbitmqctl node_health_check" --health-interval 10s --health-timeout 5s --health-retries 5
|
68
|
+
|
69
|
+
steps:
|
70
|
+
- uses: actions/checkout@master
|
71
|
+
|
72
|
+
- uses: actions/setup-ruby@v1
|
73
|
+
with:
|
74
|
+
ruby-version: ${{ matrix.ruby }}
|
75
|
+
|
76
|
+
- uses: actions/cache@v1
|
77
|
+
with:
|
78
|
+
path: vendor
|
79
|
+
key: v1-ruby-${{ matrix.ruby }}-suite-${{ matrix.suite }}
|
80
|
+
|
81
|
+
- name: Install Ruby dependencies
|
82
|
+
run: |
|
83
|
+
set -x
|
84
|
+
gem install bundler --version '1.17.3'
|
85
|
+
bundle config path "$(pwd)/vendor/bundle"
|
86
|
+
bundle config without development
|
87
|
+
${{ matrix.env }} bundle update --jobs=$(nproc) --retry=3
|
88
|
+
|
89
|
+
- name: Run rspec
|
90
|
+
env:
|
91
|
+
AMQP_SERVER: amqp://localhost:${{ job.services.rabbitmq.ports[5672] }}
|
92
|
+
run: |
|
93
|
+
${{ matrix.env }} bundle exec rspec --color ${{ matrix.spec }}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
name: Lint
|
2
|
+
on: [push]
|
3
|
+
jobs:
|
4
|
+
rubocop:
|
5
|
+
name: rubocop
|
6
|
+
runs-on: ubuntu-18.04
|
7
|
+
|
8
|
+
steps:
|
9
|
+
- uses: actions/checkout@master
|
10
|
+
- uses: actions/setup-ruby@v1
|
11
|
+
with:
|
12
|
+
ruby-version: 2.6
|
13
|
+
- uses: actions/cache@v1
|
14
|
+
with:
|
15
|
+
path: vendor
|
16
|
+
key: v1-ruby-2.6
|
17
|
+
|
18
|
+
- name: Run bundle install
|
19
|
+
run: |
|
20
|
+
bundle config path "$(pwd)/vendor/bundle"
|
21
|
+
bundle config without development,test
|
22
|
+
bundle install --jobs=4 --retry=3
|
23
|
+
|
24
|
+
- name: Run rubocop
|
25
|
+
run: bundle exec rubocop --parallel --color
|
data/.rubocop.yml
CHANGED
@@ -1,14 +1,11 @@
|
|
1
1
|
AllCops:
|
2
|
-
TargetRubyVersion: 2.
|
2
|
+
TargetRubyVersion: 2.5
|
3
3
|
Exclude:
|
4
4
|
- 'vendor/**/*'
|
5
5
|
- 'gemfiles/**/*'
|
6
6
|
|
7
|
-
Rails:
|
8
|
-
Enabled: false
|
9
|
-
|
10
7
|
|
11
|
-
Layout/
|
8
|
+
Layout/ArgumentAlignment:
|
12
9
|
EnforcedStyle: with_fixed_indentation
|
13
10
|
|
14
11
|
Layout/CaseIndentation:
|
@@ -18,6 +15,11 @@ Layout/CaseIndentation:
|
|
18
15
|
- end
|
19
16
|
IndentOneStep: true
|
20
17
|
|
18
|
+
Layout/LineLength:
|
19
|
+
Exclude:
|
20
|
+
- '*.gemspec'
|
21
|
+
- 'spec/**/*'
|
22
|
+
|
21
23
|
Layout/MultilineMethodCallIndentation:
|
22
24
|
EnforcedStyle: indented
|
23
25
|
|
@@ -30,8 +32,36 @@ Layout/SpaceInsideHashLiteralBraces:
|
|
30
32
|
EnforcedStyle: no_space
|
31
33
|
|
32
34
|
|
33
|
-
|
34
|
-
|
35
|
+
Metrics/AbcSize:
|
36
|
+
Enabled: false
|
37
|
+
|
38
|
+
Metrics/BlockLength:
|
39
|
+
Exclude:
|
40
|
+
- 'spec/**/*'
|
41
|
+
|
42
|
+
Metrics/ParameterLists:
|
43
|
+
Enabled: false
|
44
|
+
|
45
|
+
Metrics/MethodLength:
|
46
|
+
Enabled: false
|
47
|
+
|
48
|
+
|
49
|
+
Naming/FileName:
|
50
|
+
Exclude:
|
51
|
+
- lib/mnemosyne-ruby.rb
|
52
|
+
|
53
|
+
|
54
|
+
Style/Documentation:
|
55
|
+
Enabled: false
|
56
|
+
|
57
|
+
Style/HashEachMethods:
|
58
|
+
Enabled: false
|
59
|
+
|
60
|
+
Style/HashTransformKeys:
|
61
|
+
Enabled: false
|
62
|
+
|
63
|
+
Style/HashTransformValues:
|
64
|
+
Enabled: false
|
35
65
|
|
36
66
|
Style/RaiseArgs:
|
37
67
|
EnforcedStyle: compact
|
@@ -46,22 +76,3 @@ Style/Semicolon:
|
|
46
76
|
Style/RescueModifier:
|
47
77
|
Exclude:
|
48
78
|
- '**/*_spec.rb'
|
49
|
-
|
50
|
-
|
51
|
-
Metrics/LineLength:
|
52
|
-
Exclude:
|
53
|
-
- '*.gemspec'
|
54
|
-
- 'spec/**/*'
|
55
|
-
|
56
|
-
Metrics/BlockLength:
|
57
|
-
Exclude:
|
58
|
-
- 'spec/**/*'
|
59
|
-
|
60
|
-
Metrics/ParameterLists:
|
61
|
-
Enabled: false
|
62
|
-
|
63
|
-
Metrics/MethodLength:
|
64
|
-
Enabled: false
|
65
|
-
|
66
|
-
Style/Documentation:
|
67
|
-
Enabled: false
|
data/.travis.yml
CHANGED
@@ -8,32 +8,34 @@ addons:
|
|
8
8
|
packages:
|
9
9
|
- rabbitmq-server
|
10
10
|
rvm:
|
11
|
-
- 2.
|
12
|
-
- 2.
|
13
|
-
- 2.
|
14
|
-
- 2.
|
15
|
-
|
16
|
-
-
|
17
|
-
-
|
18
|
-
-
|
19
|
-
-
|
11
|
+
- 2.7.0
|
12
|
+
- 2.6.5
|
13
|
+
- 2.5.7
|
14
|
+
- 2.4.9
|
15
|
+
env:
|
16
|
+
- SPEC='--tag ~probe'
|
17
|
+
- SPEC='--tag probe:faraday' FARADAY_VERSION='~> 0.9'
|
18
|
+
- SPEC='--tag probe:faraday' FARADAY_VERSION='~> 1.0'
|
19
|
+
- SPEC='--tag probe:msgr'
|
20
|
+
- SPEC='--tag probe:rack'
|
21
|
+
- SPEC='--tag probe:rails --tag ~probe' BUNDLE_GEMFILE=gemfiles/rails_42.gemfile
|
22
|
+
- SPEC='--tag probe:rails --tag ~probe' BUNDLE_GEMFILE=gemfiles/rails_50.gemfile
|
23
|
+
- SPEC='--tag probe:rails --tag ~probe' BUNDLE_GEMFILE=gemfiles/rails_51.gemfile
|
24
|
+
- SPEC='--tag probe:rails --tag ~probe' BUNDLE_GEMFILE=gemfiles/rails_52.gemfile
|
25
|
+
- SPEC='--tag probe:rails --tag ~probe' BUNDLE_GEMFILE=gemfiles/rails_60.gemfile
|
26
|
+
- SPEC='--tag probe:restify'
|
27
|
+
- SPEC='--tag probe:sidekiq' SIDEKIQ_VERSION='~> 5.0'
|
28
|
+
- SPEC='--tag probe:sidekiq' SIDEKIQ_VERSION='~> 6.0'
|
29
|
+
|
20
30
|
before_install:
|
21
31
|
- echo yes | rvm gemset delete global
|
22
|
-
- gem install bundler
|
32
|
+
- gem install bundler --version '~> 1.0'
|
23
33
|
script:
|
24
|
-
- bundle exec
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
deploy:
|
33
|
-
provider: rubygems
|
34
|
-
api_key:
|
35
|
-
secure: s7hUPxL4RULQ398GXk6Ko/y3QtUy7bZMTzcC4sL9Opsw76IRhOY0n+c6r+S8wHH3n+cRxiLpUyXRAsLMhjd67Rn+qaBoVbEfyzZKt1EAYyskFdPf40Jlq3FjOjRjAJW+hLDYloLXqqgLIrx/ybOv0YOfKyGKmk6eBNCx9S5GPJzt15WAM4Lz+TxNuR82YhsDybcGtTtLJ1WCF5FeQ297l2OESgvikRoADhIIM3HVk6Msyqw7RwFlpoIFGPRhXZD7UmML981rxK4Gxkh5xKGJiInjzL8lYOgT3KIfSLwtp9JoDbtpKbzdIQfA8Z35aRzpLjofPFxxYsKjwmCfdKxvJf5E5hTlenrILqSIovuknHb9oNOp0aCdp52N4+B8BZl7n1muQzr1AKy/ogtkTAgmlPs5tW+qx2h6E5MU0wfy6sS0AqKtVcGaZ1u85llifY2TvYriHReBIf8vddOe6LLbDcPnaTrTnAdsk/Bx9n+Zd8A2l3vzam9RbwTjlr7ZezIY67RRknfScEO+qCt9cfdAKf57ZdpiAecDFEr9V/CdAPEBevxaoiTwzFrjO+N9BY57eGHJsPda8NwNsrBraGBgcgKOXWeg9MowfU+wWpUSbeAJDZ2zZabGRKJkXpbRNNnf3webPSaXfb9qeWrCHXXbuI8JO+PQmx6OX8IHGjqyE1E=
|
36
|
-
gem: mnemosyne-ruby
|
37
|
-
on:
|
38
|
-
tags: true
|
39
|
-
repo: mnemosyne-mon/mnemosyne-ruby
|
34
|
+
- bundle exec rspec ${SPEC}
|
35
|
+
|
36
|
+
matrix:
|
37
|
+
exclude:
|
38
|
+
- rvm: 2.4.9
|
39
|
+
env: SPEC='--tag probe:rails --tag ~probe' BUNDLE_GEMFILE=gemfiles/rails_60.gemfile
|
40
|
+
- rvm: 2.4.9
|
41
|
+
env: SPEC='--tag probe:sidekiq' SIDEKIQ_VERSION='~> 6.0'
|
data/Appraisals
CHANGED
@@ -1,20 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
appraise 'rails-60' do
|
4
|
+
group :test do
|
5
|
+
gem 'rails', '~> 6.0.0', require: false
|
6
|
+
gem 'sqlite3', '~> 1.4', require: false
|
7
|
+
end
|
8
|
+
end
|
1
9
|
|
2
10
|
appraise 'rails-52' do
|
3
|
-
|
4
|
-
|
11
|
+
group :test do
|
12
|
+
gem 'rails', '~> 5.2.0', require: false
|
13
|
+
gem 'sqlite3', '~> 1.4', require: false
|
14
|
+
end
|
5
15
|
end
|
6
16
|
|
7
17
|
appraise 'rails-51' do
|
8
|
-
|
9
|
-
|
18
|
+
group :test do
|
19
|
+
gem 'rails', '~> 5.1.0', require: false
|
20
|
+
gem 'sqlite3', '~> 1.4', require: false
|
21
|
+
end
|
10
22
|
end
|
11
23
|
|
12
24
|
appraise 'rails-50' do
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
appraise 'rails-42' do
|
18
|
-
gem 'rails', '~> 4.2.0', require: false
|
19
|
-
gem 'sqlite3', '~> 1.3.6', require: false
|
25
|
+
group :test do
|
26
|
+
gem 'rails', '~> 5.0.0', require: false
|
27
|
+
gem 'sqlite3', '~> 1.3.6', require: false
|
28
|
+
end
|
20
29
|
end
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,26 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
|
+
### Removed
|
8
|
+
- Support for Ruby 2.4 and Rails 4.2
|
9
|
+
|
10
|
+
### Fixed
|
11
|
+
- Deprecation warnings due to block capture and keyword arguments
|
12
|
+
|
13
|
+
## [1.10.0] - 2020-03-05
|
14
|
+
### Added
|
15
|
+
- Support for Faraday 1.0
|
16
|
+
|
17
|
+
## [1.9.0] - 2019-12-17
|
18
|
+
### Fixed
|
19
|
+
- [Rack] Fix exceptions raised on trace submit corrupting the response
|
20
|
+
|
21
|
+
### Added
|
22
|
+
- Rack: Collect redirect locations (#14)
|
23
|
+
|
24
|
+
## [1.8.0] - 2019-10-25
|
25
|
+
### Added
|
26
|
+
- Improve compatibility with Rails 6.0
|
7
27
|
|
8
28
|
## [1.7.1] - 2019-06-15
|
9
29
|
### Fixed
|
@@ -82,7 +102,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
82
102
|
### Added
|
83
103
|
- Add platform identifier
|
84
104
|
|
85
|
-
[
|
105
|
+
[Unreleased]: https://github.com/mnemosyne-mon/mnemosyne-ruby/compare/v1.10.0...HEAD
|
106
|
+
[1.10.0]: https://github.com/mnemosyne-mon/mnemosyne-ruby/compare/v1.9.0...v1.10.0
|
107
|
+
[1.9.0]: https://github.com/mnemosyne-mon/mnemosyne-ruby/compare/v1.8.0...v1.9.0
|
108
|
+
[1.8.0]: https://github.com/mnemosyne-mon/mnemosyne-ruby/compare/v1.7.1...v1.8.0
|
86
109
|
[1.7.1]: https://github.com/mnemosyne-mon/mnemosyne-ruby/compare/v1.7.0...v1.7.1
|
87
110
|
[1.7.0]: https://github.com/mnemosyne-mon/mnemosyne-ruby/compare/v1.6.2...v1.7.0
|
88
111
|
[1.6.2]: https://github.com/mnemosyne-mon/mnemosyne-ruby/compare/v1.6.1...v1.6.2
|
data/Gemfile
CHANGED
@@ -5,19 +5,26 @@ source 'https://rubygems.org'
|
|
5
5
|
# Specify your gem's dependencies in mnemosyne.gemspec
|
6
6
|
gemspec
|
7
7
|
|
8
|
-
gem 'appraisal'
|
9
8
|
gem 'rake', '~> 12.0'
|
10
9
|
gem 'rspec', '~> 3.6'
|
11
|
-
gem 'rubocop', '~> 0.
|
10
|
+
gem 'rubocop', '~> 0.80.1'
|
12
11
|
gem 'timecop', '~> 0.9.1'
|
13
12
|
|
14
|
-
|
15
|
-
gem '
|
13
|
+
group :test do
|
14
|
+
gem 'faraday', ENV['FARADAY_VERSION'], require: false
|
15
|
+
gem 'msgr', ENV['MSGR_VERSION'], require: false
|
16
|
+
gem 'restify', ENV['RESTIFY_VERSION'], require: false
|
17
|
+
gem 'sidekiq', ENV['SIDEKIQ_VERSION'], require: false
|
16
18
|
|
17
|
-
gem '
|
18
|
-
gem '
|
19
|
-
gem '
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
gem '
|
19
|
+
gem 'rails', require: false
|
20
|
+
gem 'sqlite3', require: false
|
21
|
+
gem 'webmock', require: false
|
22
|
+
end
|
23
|
+
|
24
|
+
group :development do
|
25
|
+
gem 'appraisal'
|
26
|
+
gem 'rake-release', '~> 1.2.1'
|
27
|
+
|
28
|
+
gem 'pry', require: false
|
29
|
+
gem 'pry-byebug', require: false
|
30
|
+
end
|
data/README.md
CHANGED
@@ -31,6 +31,8 @@ Or install it yourself as:
|
|
31
31
|
|
32
32
|
$ gem install mnemosyne
|
33
33
|
|
34
|
+
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.
|
35
|
+
|
34
36
|
## Usage
|
35
37
|
|
36
38
|
TODO
|
data/Rakefile
CHANGED
@@ -1,13 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'rake/release/task'
|
4
4
|
require 'rspec/core/rake_task'
|
5
5
|
require 'rubocop/rake_task'
|
6
6
|
|
7
|
-
|
7
|
+
task default: %i[rubocop spec]
|
8
8
|
|
9
9
|
RuboCop::RakeTask.new(:rubocop) do |task|
|
10
10
|
task.fail_on_error = false
|
11
11
|
end
|
12
12
|
|
13
|
-
|
13
|
+
RSpec::Core::RakeTask.new(:spec)
|
14
|
+
|
15
|
+
Rake::Release::Task.new do |spec|
|
16
|
+
spec.sign_tag = true
|
17
|
+
end
|
data/gemfiles/rails_50.gemfile
CHANGED
@@ -2,19 +2,26 @@
|
|
2
2
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
|
5
|
-
gem "appraisal"
|
6
5
|
gem "rake", "~> 12.0"
|
7
6
|
gem "rspec", "~> 3.6"
|
8
|
-
gem "rubocop", "~> 0.
|
9
|
-
gem "timecop", "~> 0.
|
10
|
-
|
11
|
-
|
12
|
-
gem "faraday", require: false
|
13
|
-
gem "msgr", require: false
|
14
|
-
gem "
|
15
|
-
gem "
|
16
|
-
gem "
|
17
|
-
gem "sqlite3", "~> 1.3.6", require: false
|
18
|
-
gem "webmock", require: false
|
7
|
+
gem "rubocop", "~> 0.80.1"
|
8
|
+
gem "timecop", "~> 0.9.1"
|
9
|
+
|
10
|
+
group :test do
|
11
|
+
gem "faraday", nil, require: false
|
12
|
+
gem "msgr", nil, require: false
|
13
|
+
gem "restify", nil, require: false
|
14
|
+
gem "sidekiq", nil, require: false
|
15
|
+
gem "rails", "~> 5.0.0", require: false
|
16
|
+
gem "sqlite3", "~> 1.3.6", require: false
|
17
|
+
gem "webmock", require: false
|
18
|
+
end
|
19
|
+
|
20
|
+
group :development do
|
21
|
+
gem "appraisal"
|
22
|
+
gem "rake-release", "~> 1.2.1"
|
23
|
+
gem "pry", require: false
|
24
|
+
gem "pry-byebug", require: false
|
25
|
+
end
|
19
26
|
|
20
27
|
gemspec path: "../"
|
data/gemfiles/rails_51.gemfile
CHANGED
@@ -2,19 +2,26 @@
|
|
2
2
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
|
5
|
-
gem "appraisal"
|
6
5
|
gem "rake", "~> 12.0"
|
7
6
|
gem "rspec", "~> 3.6"
|
8
|
-
gem "rubocop", "~> 0.
|
9
|
-
gem "timecop", "~> 0.
|
10
|
-
|
11
|
-
|
12
|
-
gem "faraday", require: false
|
13
|
-
gem "msgr", require: false
|
14
|
-
gem "
|
15
|
-
gem "
|
16
|
-
gem "
|
17
|
-
gem "sqlite3", "~> 1.4", require: false
|
18
|
-
gem "webmock", require: false
|
7
|
+
gem "rubocop", "~> 0.80.1"
|
8
|
+
gem "timecop", "~> 0.9.1"
|
9
|
+
|
10
|
+
group :test do
|
11
|
+
gem "faraday", nil, require: false
|
12
|
+
gem "msgr", nil, require: false
|
13
|
+
gem "restify", nil, require: false
|
14
|
+
gem "sidekiq", nil, require: false
|
15
|
+
gem "rails", "~> 5.1.0", require: false
|
16
|
+
gem "sqlite3", "~> 1.4", require: false
|
17
|
+
gem "webmock", require: false
|
18
|
+
end
|
19
|
+
|
20
|
+
group :development do
|
21
|
+
gem "appraisal"
|
22
|
+
gem "rake-release", "~> 1.2.1"
|
23
|
+
gem "pry", require: false
|
24
|
+
gem "pry-byebug", require: false
|
25
|
+
end
|
19
26
|
|
20
27
|
gemspec path: "../"
|
data/gemfiles/rails_52.gemfile
CHANGED
@@ -2,19 +2,26 @@
|
|
2
2
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
|
5
|
-
gem "appraisal"
|
6
5
|
gem "rake", "~> 12.0"
|
7
6
|
gem "rspec", "~> 3.6"
|
8
|
-
gem "rubocop", "~> 0.
|
9
|
-
gem "timecop", "~> 0.
|
10
|
-
|
11
|
-
|
12
|
-
gem "faraday", require: false
|
13
|
-
gem "msgr", require: false
|
14
|
-
gem "
|
15
|
-
gem "
|
16
|
-
gem "
|
17
|
-
gem "sqlite3", "~> 1.4", require: false
|
18
|
-
gem "webmock", require: false
|
7
|
+
gem "rubocop", "~> 0.80.1"
|
8
|
+
gem "timecop", "~> 0.9.1"
|
9
|
+
|
10
|
+
group :test do
|
11
|
+
gem "faraday", nil, require: false
|
12
|
+
gem "msgr", nil, require: false
|
13
|
+
gem "restify", nil, require: false
|
14
|
+
gem "sidekiq", nil, require: false
|
15
|
+
gem "rails", "~> 5.2.0", require: false
|
16
|
+
gem "sqlite3", "~> 1.4", require: false
|
17
|
+
gem "webmock", require: false
|
18
|
+
end
|
19
|
+
|
20
|
+
group :development do
|
21
|
+
gem "appraisal"
|
22
|
+
gem "rake-release", "~> 1.2.1"
|
23
|
+
gem "pry", require: false
|
24
|
+
gem "pry-byebug", require: false
|
25
|
+
end
|
19
26
|
|
20
27
|
gemspec path: "../"
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "rake", "~> 12.0"
|
6
|
+
gem "rspec", "~> 3.6"
|
7
|
+
gem "rubocop", "~> 0.80.1"
|
8
|
+
gem "timecop", "~> 0.9.1"
|
9
|
+
|
10
|
+
group :test do
|
11
|
+
gem "faraday", nil, require: false
|
12
|
+
gem "msgr", nil, require: false
|
13
|
+
gem "restify", nil, require: false
|
14
|
+
gem "sidekiq", nil, require: false
|
15
|
+
gem "rails", "~> 6.0.0", require: false
|
16
|
+
gem "sqlite3", "~> 1.4", require: false
|
17
|
+
gem "webmock", require: false
|
18
|
+
end
|
19
|
+
|
20
|
+
group :development do
|
21
|
+
gem "appraisal"
|
22
|
+
gem "rake-release", "~> 1.2.1"
|
23
|
+
gem "pry", require: false
|
24
|
+
gem "pry-byebug", require: false
|
25
|
+
end
|
26
|
+
|
27
|
+
gemspec path: "../"
|
@@ -13,7 +13,7 @@ module Mnemosyne
|
|
13
13
|
attr_reader :exchange
|
14
14
|
attr_reader :server
|
15
15
|
|
16
|
-
def initialize(config)
|
16
|
+
def initialize(config)
|
17
17
|
@platform = config.fetch('platform', 'default').to_s.strip.freeze
|
18
18
|
@application = config.fetch('application', nil).to_s.strip.freeze
|
19
19
|
@enabled = config.fetch('enabled', true)
|
@@ -57,7 +57,7 @@ module Mnemosyne
|
|
57
57
|
'amqps' => 5671
|
58
58
|
}.freeze
|
59
59
|
|
60
|
-
def make_amqp_uri(amqp)
|
60
|
+
def make_amqp_uri(amqp)
|
61
61
|
uri = URI('')
|
62
62
|
|
63
63
|
uri.scheme = amqp[:scheme]
|
data/lib/mnemosyne/global.rb
CHANGED
@@ -5,13 +5,13 @@ module Mnemosyne
|
|
5
5
|
def trace(name, meta: {})
|
6
6
|
::ActiveSupport::Notifications.instrument 'trace.mnemosyne',
|
7
7
|
name: name, meta: meta do
|
8
|
-
|
9
8
|
yield
|
10
9
|
end
|
11
10
|
end
|
12
11
|
|
13
12
|
def attach_error(err)
|
14
13
|
return unless (trace = ::Mnemosyne::Instrumenter.current_trace)
|
14
|
+
|
15
15
|
trace.attach_error(err)
|
16
16
|
end
|
17
17
|
end
|
@@ -27,10 +27,11 @@ module Mnemosyne
|
|
27
27
|
def trace(name, **kwargs)
|
28
28
|
if (trace = current_trace)
|
29
29
|
return yield trace if block_given?
|
30
|
+
|
30
31
|
return trace
|
31
32
|
end
|
32
33
|
|
33
|
-
trace = self.current_trace = Trace.new(self, name, kwargs)
|
34
|
+
trace = self.current_trace = Trace.new(self, name, **kwargs)
|
34
35
|
|
35
36
|
return trace unless block_given?
|
36
37
|
|
@@ -67,9 +68,9 @@ module Mnemosyne
|
|
67
68
|
|
68
69
|
@instance = new(config: config, client: client)
|
69
70
|
end
|
70
|
-
rescue StandardError =>
|
71
|
+
rescue StandardError => e
|
71
72
|
::Mnemosyne::Logging.logger.warn(Mnemosyne) do
|
72
|
-
"Unable to start instrumenter: #{
|
73
|
+
"Unable to start instrumenter: #{e}"
|
73
74
|
end
|
74
75
|
|
75
76
|
raise
|
@@ -84,13 +85,15 @@ module Mnemosyne
|
|
84
85
|
@instance = old
|
85
86
|
end
|
86
87
|
|
87
|
-
def trace(*args)
|
88
|
+
def trace(*args, **kwargs)
|
88
89
|
return unless (instrumenter = instance)
|
89
|
-
|
90
|
+
|
91
|
+
instrumenter.trace(*args, **kwargs)
|
90
92
|
end
|
91
93
|
|
92
94
|
def current_trace
|
93
95
|
return unless (instrumenter = instance)
|
96
|
+
|
94
97
|
instrumenter.current_trace
|
95
98
|
end
|
96
99
|
end
|
@@ -21,10 +21,10 @@ module Mnemosyne
|
|
21
21
|
|
22
22
|
env[:request_headers].merge!({
|
23
23
|
'X-Mnemosyne-Transaction' => trace.transaction,
|
24
|
-
'X-Mnemosyne-Origin' => span.uuid
|
24
|
+
'X-Mnemosyne-Origin' => span.uuid
|
25
25
|
}.reject {|_, v| v.nil? })
|
26
26
|
|
27
|
-
@app.call(env).on_complete do |env|
|
27
|
+
@app.call(env).on_complete do |env| # rubocop:disable Lint/ShadowingOuterLocalVariable
|
28
28
|
span.meta[:status] = env[:status]
|
29
29
|
|
30
30
|
trace << span.finish!
|
@@ -16,24 +16,20 @@ module Mnemosyne
|
|
16
16
|
@body.respond_to?(*args)
|
17
17
|
end
|
18
18
|
|
19
|
-
def method_missing(*args)
|
19
|
+
def method_missing(*args, &block)
|
20
20
|
super if args.first && args.first.to_s == 'to_ary'
|
21
|
-
|
22
|
-
if block_given?
|
23
|
-
@body.__send__(*args, &Proc.new)
|
24
|
-
else
|
25
|
-
@body.__send__(*args)
|
26
|
-
end
|
21
|
+
@body.__send__(*args, &block)
|
27
22
|
end
|
28
23
|
|
29
24
|
def close
|
30
25
|
return if @closed
|
26
|
+
|
31
27
|
@closed = true
|
32
28
|
|
33
29
|
begin
|
34
30
|
@body.close if @body.respond_to? :close
|
35
31
|
ensure
|
36
|
-
|
32
|
+
_submit_trace
|
37
33
|
end
|
38
34
|
end
|
39
35
|
|
@@ -41,19 +37,28 @@ module Mnemosyne
|
|
41
37
|
@closed
|
42
38
|
end
|
43
39
|
|
44
|
-
def each(*args)
|
45
|
-
@body.each(*args, &
|
40
|
+
def each(*args, &block)
|
41
|
+
@body.each(*args, &block)
|
46
42
|
rescue StandardError, LoadError, SyntaxError => e
|
47
43
|
@trace.attach_error(e)
|
48
44
|
raise
|
49
45
|
end
|
46
|
+
|
47
|
+
private
|
48
|
+
|
49
|
+
def _submit_trace
|
50
|
+
@trace.submit
|
51
|
+
rescue Exception => e # rubocop:disable Lint/RescueException
|
52
|
+
::Mnemosyne::Logging.logger.error \
|
53
|
+
"Error while submitting trace: #{e}\n #{e.backtrace.join("\n ")}"
|
54
|
+
end
|
50
55
|
end
|
51
56
|
|
52
57
|
def initialize(app)
|
53
58
|
@app = app
|
54
59
|
end
|
55
60
|
|
56
|
-
def call(env)
|
61
|
+
def call(env)
|
57
62
|
origin = env.fetch('HTTP_X_MNEMOSYNE_ORIGIN', false)
|
58
63
|
transaction = env.fetch('HTTP_X_MNEMOSYNE_TRANSACTION') do
|
59
64
|
::SecureRandom.uuid
|
@@ -85,7 +90,7 @@ module Mnemosyne
|
|
85
90
|
|
86
91
|
raise
|
87
92
|
ensure
|
88
|
-
trace
|
93
|
+
trace&.release
|
89
94
|
end
|
90
95
|
|
91
96
|
private
|
@@ -109,7 +114,10 @@ module Mnemosyne
|
|
109
114
|
|
110
115
|
return unless headers
|
111
116
|
|
112
|
-
trace.meta
|
117
|
+
trace.meta.merge!({
|
118
|
+
content_type: headers['Content-Type'],
|
119
|
+
location: headers['Location']
|
120
|
+
}.compact)
|
113
121
|
end
|
114
122
|
end
|
115
123
|
end
|
@@ -19,11 +19,11 @@ module Mnemosyne
|
|
19
19
|
origin: origin,
|
20
20
|
meta: meta
|
21
21
|
|
22
|
-
trace
|
22
|
+
trace&.start!
|
23
23
|
|
24
24
|
yield
|
25
|
-
rescue StandardError, LoadError, SyntaxError =>
|
26
|
-
trace.attach_error(
|
25
|
+
rescue StandardError, LoadError, SyntaxError => e
|
26
|
+
trace.attach_error(e)
|
27
27
|
raise
|
28
28
|
ensure
|
29
29
|
if trace
|
data/lib/mnemosyne/probes.rb
CHANGED
@@ -17,9 +17,11 @@ module Mnemosyne
|
|
17
17
|
|
18
18
|
module Extension
|
19
19
|
def lock!
|
20
|
-
|
21
|
-
if
|
22
|
-
|
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
|
+
|
23
25
|
insert(idx, ::Mnemosyne::Middleware::Faraday)
|
24
26
|
else
|
25
27
|
use(::Mnemosyne::Middleware::Faraday)
|
@@ -4,11 +4,11 @@ module Mnemosyne
|
|
4
4
|
module Probes
|
5
5
|
module Msgr
|
6
6
|
module Client
|
7
|
-
NAME = 'external.publish.msgr'
|
7
|
+
NAME = 'external.publish.msgr'
|
8
8
|
|
9
9
|
class Probe < ::Mnemosyne::Probe
|
10
10
|
def setup
|
11
|
-
::Msgr::Client.
|
11
|
+
::Msgr::Client.prepend Instrumentation
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
@@ -4,16 +4,16 @@ module Mnemosyne
|
|
4
4
|
module Probes
|
5
5
|
module Msgr
|
6
6
|
module Consumer
|
7
|
-
NAME = 'app.messaging.receive.msgr'
|
7
|
+
NAME = 'app.messaging.receive.msgr'
|
8
8
|
|
9
9
|
class Probe < ::Mnemosyne::Probe
|
10
10
|
def setup
|
11
|
-
::Msgr::Consumer.
|
11
|
+
::Msgr::Consumer.prepend Instrumentation
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
15
|
module Instrumentation
|
16
|
-
def dispatch(message)
|
16
|
+
def dispatch(message)
|
17
17
|
route = message.route
|
18
18
|
metadata = message.metadata
|
19
19
|
headers = metadata.headers || {}
|
@@ -57,7 +57,7 @@ module Mnemosyne
|
|
57
57
|
|
58
58
|
super
|
59
59
|
rescue StandardError, LoadError, SyntaxError => e
|
60
|
-
trace
|
60
|
+
trace&.attach_error(e)
|
61
61
|
raise
|
62
62
|
ensure
|
63
63
|
if trace
|
data/lib/mnemosyne/railtie.rb
CHANGED
data/lib/mnemosyne/registry.rb
CHANGED
data/lib/mnemosyne/trace.rb
CHANGED
@@ -57,12 +57,13 @@ module Mnemosyne
|
|
57
57
|
end
|
58
58
|
|
59
59
|
Error = Struct.new(:error) do
|
60
|
-
BT_REGEXP = /^((?:[a-zA-Z]:)?[^:]+):(\d+)(?::in `([^']+)')
|
60
|
+
BT_REGEXP = /^((?:[a-zA-Z]:)?[^:]+):(\d+)(?::in `([^']+)')?$/.freeze
|
61
61
|
|
62
62
|
def serialize
|
63
63
|
{
|
64
64
|
type: error.class.name,
|
65
65
|
text: error.message.to_s,
|
66
|
+
cause: serialize_cause,
|
66
67
|
stacktrace: serialize_backtrace
|
67
68
|
}.compact
|
68
69
|
end
|
@@ -78,6 +79,10 @@ module Mnemosyne
|
|
78
79
|
{file: md[1], line: md[2], call: md[3], raw: md[0]}
|
79
80
|
end
|
80
81
|
end
|
82
|
+
|
83
|
+
def serialize_cause
|
84
|
+
self.class.new(error.cause).serialize if error.cause
|
85
|
+
end
|
81
86
|
end
|
82
87
|
end
|
83
88
|
end
|
data/lib/mnemosyne/version.rb
CHANGED
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: 1.
|
4
|
+
version: 1.11.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: 2020-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -59,6 +59,9 @@ executables: []
|
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
|
+
- ".editorconfig"
|
63
|
+
- ".github/workflows/build.yml"
|
64
|
+
- ".github/workflows/lint.yml"
|
62
65
|
- ".gitignore"
|
63
66
|
- ".rspec"
|
64
67
|
- ".rubocop.yml"
|
@@ -69,10 +72,10 @@ files:
|
|
69
72
|
- LICENSE
|
70
73
|
- README.md
|
71
74
|
- Rakefile
|
72
|
-
- gemfiles/rails_42.gemfile
|
73
75
|
- gemfiles/rails_50.gemfile
|
74
76
|
- gemfiles/rails_51.gemfile
|
75
77
|
- gemfiles/rails_52.gemfile
|
78
|
+
- gemfiles/rails_60.gemfile
|
76
79
|
- lib/mnemosyne-ruby.rb
|
77
80
|
- lib/mnemosyne.rb
|
78
81
|
- lib/mnemosyne/client.rb
|
@@ -134,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
137
|
- !ruby/object:Gem::Version
|
135
138
|
version: '0'
|
136
139
|
requirements: []
|
137
|
-
rubygems_version: 3.
|
140
|
+
rubygems_version: 3.2.1
|
138
141
|
signing_key:
|
139
142
|
specification_version: 4
|
140
143
|
summary: Ruby/Rails client for Mnemosyne APM
|
data/gemfiles/rails_42.gemfile
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
gem "appraisal"
|
6
|
-
gem "rake", "~> 12.0"
|
7
|
-
gem "rspec", "~> 3.6"
|
8
|
-
gem "rubocop", "~> 0.67.1"
|
9
|
-
gem "timecop", "~> 0.8.0"
|
10
|
-
gem "pry", require: false
|
11
|
-
gem "pry-byebug", require: false
|
12
|
-
gem "faraday", require: false
|
13
|
-
gem "msgr", require: false
|
14
|
-
gem "rails", "~> 4.2.0", require: false
|
15
|
-
gem "restify", require: false
|
16
|
-
gem "sidekiq", require: false
|
17
|
-
gem "sqlite3", "~> 1.3.6", require: false
|
18
|
-
gem "webmock", require: false
|
19
|
-
|
20
|
-
gemspec path: "../"
|