roda-scoutapm 0.1.0 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -0
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +1 -1
- data/README.md +31 -5
- data/lib/roda/plugins/scoutapm/version.rb +1 -1
- data/lib/roda/plugins/scoutapm.rb +9 -9
- data/roda-scoutapm.gemspec +38 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2d841f5f709f8a5a25de0c3e2cbd117475f74c7a333c12465ea4ab55f996d9e
|
4
|
+
data.tar.gz: 24bfd4bd3f231597a5dbcd550c2aa6b527345b7c5113cc37531094c40974d148
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f73c7df1298c1d874289a00bd3185f04fb5c552863136ba3849f3f4a98101dda4a20bcb220b4fad599d3eff9c4e44b48122910306ae9f4cf9813987b5746d794
|
7
|
+
data.tar.gz: 8cc57db8f374921d1df4147ca687a024b30391b3f39c2cabdb112f2a7b14740360bc7664791bcfab40a660636cea8db821058c484517b5bae1f2de8b5dc583d5
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
# Roda
|
1
|
+
# Roda plugin for ScoutApm instrumentation
|
2
2
|
|
3
|
-
|
3
|
+
This plugin adds [ScoutApm](https://scoutapm.com/) instrumentation to [Roda](https://github.com/jeremyevans/roda) applications.
|
4
4
|
|
5
|
-
|
5
|
+
It uses ScoutApm [Rack instrumentation ](https://scoutapm.com/docs/ruby/rack)
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -16,7 +16,33 @@ If bundler is not being used to manage dependencies, install the gem by executin
|
|
16
16
|
|
17
17
|
## Usage
|
18
18
|
|
19
|
-
|
19
|
+
First, you need to add credentials to config/scout_apm.yml or ENV variables as ScoutApm requires.
|
20
|
+
|
21
|
+
Than you need to add the ScoutApm::Rack.install! startup call as close to the spot you run your Rack application as possible. install! should be called after you require other gems (ActiveRecord, Mongo, etc) to install instrumentation for those libraries.
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
#config.ru
|
25
|
+
require_relative 'app'
|
26
|
+
|
27
|
+
require 'scout_apm'
|
28
|
+
ScoutApm::Rack.install!
|
29
|
+
|
30
|
+
run App
|
31
|
+
```
|
32
|
+
|
33
|
+
```ruby
|
34
|
+
class App < Roda
|
35
|
+
plugin :scoutapm
|
36
|
+
|
37
|
+
route do |r|
|
38
|
+
r.is 'foo' do
|
39
|
+
r.get do
|
40
|
+
'hello world'
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
```
|
20
46
|
|
21
47
|
## Development
|
22
48
|
|
@@ -26,7 +52,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
26
52
|
|
27
53
|
## Contributing
|
28
54
|
|
29
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
55
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/Alexey2257/roda-scoutapm.
|
30
56
|
|
31
57
|
## License
|
32
58
|
|
@@ -1,21 +1,21 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
2
|
+
|
3
|
+
require_relative "../../blank" unless String.new.respond_to?(:blank?)
|
3
4
|
|
4
5
|
class Roda
|
6
|
+
# Integrate in Roda
|
5
7
|
module RodaPlugins
|
6
8
|
module Scoutapm
|
7
|
-
#
|
8
|
-
# def call(env)
|
9
|
-
# ScoutApm::Rack.transaction(env['REQUEST_PATH'], env) do
|
10
|
-
# app.call(env)
|
11
|
-
# end
|
12
|
-
# end
|
13
|
-
# end
|
9
|
+
# Inspect transaction on every request
|
14
10
|
module RequestMethods
|
15
11
|
private
|
16
12
|
|
17
13
|
def always
|
18
|
-
|
14
|
+
if defined? ::ScoutApm
|
15
|
+
::ScoutApm::Rack.transaction(inspect.gsub(/[#<>]/, ""), env) do
|
16
|
+
super
|
17
|
+
end
|
18
|
+
else
|
19
19
|
super
|
20
20
|
end
|
21
21
|
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path("lib", __dir__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require "roda/plugins/scoutapm/version"
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = "roda-scoutapm"
|
9
|
+
spec.version = Roda::RodaPlugins::Scoutapm::VERSION
|
10
|
+
spec.authors = ["Alexey Ivanov"]
|
11
|
+
spec.email = ["a.ivanov@3commas.io"]
|
12
|
+
|
13
|
+
spec.summary = "ScoutApm instrumentation for Roda apps/routes"
|
14
|
+
spec.description = "ScoutApm instrumentation for Roda apps/routes"
|
15
|
+
spec.homepage = "https://github.com/Alexey2257/roda-scoutapm"
|
16
|
+
spec.license = "MIT"
|
17
|
+
spec.required_ruby_version = ">= 2.6"
|
18
|
+
|
19
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
20
|
+
spec.metadata["source_code_uri"] = "https://github.com/Alexey2257/roda-scoutapm"
|
21
|
+
spec.metadata["changelog_uri"] = "https://github.com/Alexey2257/roda-scoutapm/CHANGELOG"
|
22
|
+
|
23
|
+
# Specify which files should be added to the gem when it is released.
|
24
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
25
|
+
spec.files = Dir.chdir(__dir__) do
|
26
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
27
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
28
|
+
end
|
29
|
+
end
|
30
|
+
spec.bindir = "exe"
|
31
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
32
|
+
spec.require_paths = ["lib"]
|
33
|
+
|
34
|
+
spec.add_dependency "roda"
|
35
|
+
spec.add_dependency "scout_apm"
|
36
|
+
|
37
|
+
spec.metadata["rubygems_mfa_required"] = "true"
|
38
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roda-scoutapm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexey Ivanov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-11-
|
11
|
+
date: 2022-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: roda
|
@@ -56,6 +56,7 @@ files:
|
|
56
56
|
- lib/roda/plugins/scoutapm.rb
|
57
57
|
- lib/roda/plugins/scoutapm/version.rb
|
58
58
|
- lib/roda/scoutapm.rb
|
59
|
+
- roda-scoutapm.gemspec
|
59
60
|
- sig/roda/scoutapm.rbs
|
60
61
|
homepage: https://github.com/Alexey2257/roda-scoutapm
|
61
62
|
licenses:
|
@@ -64,6 +65,7 @@ metadata:
|
|
64
65
|
homepage_uri: https://github.com/Alexey2257/roda-scoutapm
|
65
66
|
source_code_uri: https://github.com/Alexey2257/roda-scoutapm
|
66
67
|
changelog_uri: https://github.com/Alexey2257/roda-scoutapm/CHANGELOG
|
68
|
+
rubygems_mfa_required: 'true'
|
67
69
|
post_install_message:
|
68
70
|
rdoc_options: []
|
69
71
|
require_paths:
|
@@ -72,7 +74,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
72
74
|
requirements:
|
73
75
|
- - ">="
|
74
76
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
77
|
+
version: '2.6'
|
76
78
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
79
|
requirements:
|
78
80
|
- - ">="
|