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: e6c121e22a45831cb724e73f4ed0d9d24f46f384
4
- data.tar.gz: b12d4b6815e8b599f627f2bc2500f9cd8abddd68
3
+ metadata.gz: 7b3640f070cbad3d5c18fbd06cd7994528a319fa
4
+ data.tar.gz: 350802302c0d2482ab6d420e003147c2b33a6a6d
5
5
  SHA512:
6
- metadata.gz: 6b12d3e0dc5c05a095f8755ecdddd806616659e2acf2dac27bf5f797b826caee0f4bb94d5fc7d97d0213f14ef31f79bc6774a7cdd717900c1cc34f1f0090d24b
7
- data.tar.gz: c2bc9f2085902de1f6ff2e6a406db6b02baab1380f74ae60190fbfa27a9ae02866311b3f8b2a226d94d1b912b67ec45d5ab579d7856904b94d878005fecf52ce
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
- action = "#{env['PATH_INFO']}"
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)
@@ -1,5 +1,5 @@
1
1
  module Appsignal
2
2
  module Grape
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  end
@@ -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: "/hello/1337", class: "API"}
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/:id")
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: "/api/v1/hello/mark", class: "API"}
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/:version/hello/:name")
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-appsignal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Madsen