grape-appsignal 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef8b6005a99f1788d2cf708e934499bd6d7938e5
|
4
|
+
data.tar.gz: 64364dfa86711b95f2b48fdb4aacedad5788180b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c08db89ea7ec6ee1d9ef30fcdd231d34e8513a094a1282fa735b4e08eb9cced781b2f70ae505e54b4c723ab089c6bdccd9279e21a6f3dab605beda2c4df5f008
|
7
|
+
data.tar.gz: c5304941d5780db740801216f542910671df179f091f42200cda51c3de0873ab14b5ba681fc93270069584548f2cd83c320ffe67f3242051aa332990476f4a3a
|
@@ -10,8 +10,9 @@ module Appsignal
|
|
10
10
|
|
11
11
|
def call(env)
|
12
12
|
req = ::Rack::Request.new(env)
|
13
|
+
metric_action = env['PATH_INFO'].gsub("/", ".")
|
13
14
|
request_path = env['api.endpoint'].routes.first.route_path[1..-1].gsub(/\(\.:format\)\z/, "")
|
14
|
-
metric_name = "process_action.
|
15
|
+
metric_name = "process_action.api#{metric_action}"
|
15
16
|
action = "#{req.request_method}::#{request_path}"
|
16
17
|
ActiveSupport::Notifications.instrument(metric_name, { method: req.request_method, path: request_path, action: action } ) do |payload|
|
17
18
|
@app.call(env)
|
@@ -16,7 +16,7 @@ describe Appsignal::Grape::Middleware do
|
|
16
16
|
|
17
17
|
before(:all) do
|
18
18
|
@events = []
|
19
|
-
ActiveSupport::Notifications.subscribe('process_action.
|
19
|
+
ActiveSupport::Notifications.subscribe('process_action.api.hello.mark') do |*args|
|
20
20
|
@events << ActiveSupport::Notifications::Event.new(*args)
|
21
21
|
end
|
22
22
|
end
|