grape-appsignal 0.2.1 → 0.2.2
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: 7b3640f070cbad3d5c18fbd06cd7994528a319fa
|
4
|
+
data.tar.gz: 350802302c0d2482ab6d420e003147c2b33a6a6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17beb0ede9668ebce99d084551b9d46b43bb6295f0823f469d1cfb8558ad56fe7699b3e32bbe692e223f832ac25ccbcadc8bc5258081210f4f39fdf487483fb8
|
7
|
+
data.tar.gz: fdbdca8b4ecbdc8bd654c81b96256ac5ba8b24debf5ba8b4103f8a7a9e29407de0e8b14cd014c237fb7cd868f379b2d9c9e2dd5e9cb777798d586d4de109f959
|
@@ -13,9 +13,12 @@ module Appsignal
|
|
13
13
|
method = env['REQUEST_METHOD']
|
14
14
|
|
15
15
|
request_path = env['api.endpoint'].routes.first.route_path[1..-1].sub(/\(\.:format\)\z/, "")
|
16
|
+
|
16
17
|
metric_name = "grape.#{req.request_method}.#{request_path}"
|
17
|
-
|
18
|
+
metric_name = metric_name.gsub(/\/:?/, '.')
|
18
19
|
|
20
|
+
action = "#{env['PATH_INFO']}"
|
21
|
+
action = action.gsub(/\//, '::')
|
19
22
|
|
20
23
|
ActiveSupport::Notifications.instrument(metric_name, { method: method, path: request_path, action: action, class: "API" } ) do |payload|
|
21
24
|
@app.call(env)
|
@@ -37,12 +37,12 @@ describe Appsignal::Grape::Middleware do
|
|
37
37
|
|
38
38
|
it "delivers a payload consistent with the API call."do
|
39
39
|
expect(subject.payload ).to eq(
|
40
|
-
{ method: "GET" , path: "hello/:id", action: "
|
40
|
+
{ method: "GET" , path: "hello/:id", action: "::hello::1337", class: "API"}
|
41
41
|
)
|
42
42
|
end
|
43
43
|
|
44
44
|
it "names the payload consistent with the API call."do
|
45
|
-
expect(subject.name ).to eq("grape.GET.hello
|
45
|
+
expect(subject.name ).to eq("grape.GET.hello.id")
|
46
46
|
end
|
47
47
|
|
48
48
|
context "verify the api request" do
|
@@ -70,12 +70,12 @@ describe Appsignal::Grape::Middleware do
|
|
70
70
|
|
71
71
|
it "delivers a payload consistent with the API call."do
|
72
72
|
expect(subject.payload ).to eq(
|
73
|
-
{ method: "GET" , path: "api/:version/hello/:name", action: "
|
73
|
+
{ method: "GET" , path: "api/:version/hello/:name", action: "::api::v1::hello::mark", class: "API"}
|
74
74
|
)
|
75
75
|
end
|
76
76
|
|
77
77
|
it "names the payload consistent with the API call."do
|
78
|
-
expect(subject.name ).to eq("grape.GET.api
|
78
|
+
expect(subject.name ).to eq("grape.GET.api.version.hello.name")
|
79
79
|
end
|
80
80
|
|
81
81
|
context "verify the api request" do
|