roda-appsignal 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +18 -0
- data/lib/roda/plugins/appsignal.rb +7 -2
- data/lib/roda/plugins/appsignal/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30ff00b9d090a6e013428af44a3e57d2f315b40f41d16131edc4eb935161d639
|
4
|
+
data.tar.gz: 5d58424ea81328d2e56af79d1053d179fe545259a29091e4deb85ef2b03b5c28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb5185990125e3afdda78422d96077cec91133ca55a3cc9cdc17747c76b23e03bfb4ea2d48e85f38c8c5a70a13de0623bc44e77e189514988b13b6bc29a50f72
|
7
|
+
data.tar.gz: 68aea34e5952ea398a9e94b917e605dd0aaf0754c1cbb9e556be663d79f71dc632ffdf718c9fc43f46ae9506ed57e1feb34026f19632b0eff7960fa0177ee0bf
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -44,6 +44,24 @@ class App < Roda
|
|
44
44
|
end
|
45
45
|
```
|
46
46
|
|
47
|
+
You can also sanitize the action name via a proc argument:
|
48
|
+
|
49
|
+
```ruby
|
50
|
+
class App < Roda
|
51
|
+
|
52
|
+
plugin :appsignal, proc { |name| name.gsub!(/\d+/, ':id') }
|
53
|
+
|
54
|
+
route do |r|
|
55
|
+
r.is 'foo' do
|
56
|
+
r.is Integer do
|
57
|
+
# will be named/instrumented as 'App::RodaRequest GET /foo/:id'
|
58
|
+
'hello world'
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
```
|
64
|
+
|
47
65
|
## Development
|
48
66
|
|
49
67
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
@@ -7,8 +7,11 @@ class Roda
|
|
7
7
|
# Example:
|
8
8
|
#
|
9
9
|
# plugin :appsignal
|
10
|
+
# plugin :appsignal, proc { |action_name| action_name.gsub!(/\d+\/, '') }
|
11
|
+
#
|
10
12
|
module Appsignal
|
11
|
-
def self.configure(app)
|
13
|
+
def self.configure(app, sanitize = proc { |name| name })
|
14
|
+
app.opts[:appsignal_sanitize] = sanitize
|
12
15
|
app.use ::Appsignal::Rack::GenericInstrumentation
|
13
16
|
end
|
14
17
|
|
@@ -16,7 +19,9 @@ class Roda
|
|
16
19
|
private
|
17
20
|
|
18
21
|
def _roda_before_10__appsignal
|
19
|
-
::Appsignal.set_action(
|
22
|
+
::Appsignal.set_action(
|
23
|
+
opts[:appsignal_sanitize].call(request.inspect.gsub!(/#|<|>/, ''))
|
24
|
+
)
|
20
25
|
end
|
21
26
|
end
|
22
27
|
end
|