roda-scoutapm 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -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 +7 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45167d05c543a2212344b604384783c5ace0d07e48b8e1c97fb09747b459cbf7
|
4
|
+
data.tar.gz: 4f2c446cc7df726e6cd2055c7a71326cc90aa0bd97d9abf1ee79752e3cf3b843
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eceae0beddec7717e8011f76a107bc772aab89b59968418c6761424e3fe2fa67877418590e5ccc85c6611461e5fda78b604a0eef8e0aa1d33c8a07fd334438b5
|
7
|
+
data.tar.gz: a2d39c9d18bad7223b9d1ae8ab84c5be4e9f9ded3ef4599d5884fb89ed7e3d7dc19fa7e40cec7a22c052670cf5f5843cf41f7ecd0f099770379c272bb4df8095
|
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,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
2
|
+
|
3
|
+
require_relative "../../blank"
|
3
4
|
|
4
5
|
class Roda
|
5
6
|
module RodaPlugins
|
@@ -15,7 +16,11 @@ class Roda
|
|
15
16
|
private
|
16
17
|
|
17
18
|
def always
|
18
|
-
|
19
|
+
if defined? ::ScoutApm
|
20
|
+
::ScoutApm::Rack.transaction(inspect.gsub(/[#<>]/, ""), env) do
|
21
|
+
super
|
22
|
+
end
|
23
|
+
else
|
19
24
|
super
|
20
25
|
end
|
21
26
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexey Ivanov
|
@@ -72,7 +72,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '2.6'
|
76
76
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
77
|
requirements:
|
78
78
|
- - ">="
|