grape-appsignal 0.1.1 → 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/README.md +12 -5
- data/lib/grape-appsignal/middleware.rb +1 -1
- data/lib/grape-appsignal/version.rb +1 -1
- data/spec/grape-appsignal/middleware_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 801fa49a4ee1290f3145ce8bfd2910472016e0b4
|
4
|
+
data.tar.gz: 2d11531026cd6c0c50aef962514fea5a5ddadc2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b14855bf668efacee9e6a1f73843fe12c4faf65b08002956316b3782cd3b0d4d0b5cf23a0864906148b4ccf0eb3f5d34e457968ed3df9aca8c53fdf63824f2fd
|
7
|
+
data.tar.gz: 44e97b5ab1b563e01f03741d1d06a93c46b87af7b587ab045af011fa85c9c24060d0eefb74c0180d2fe83ab9542601661485ac11f2c35cfc17e1923590d66816
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Appsignal::Grape
|
2
2
|
|
3
|
-
AppSignal intergation for [Grape][
|
3
|
+
[AppSignal][0] intergation for [Grape][1], based on code from these [NewRelic][2] and [Liberato][3] gems.
|
4
4
|
|
5
5
|
[![Build Status](https://travis-ci.org/aai/grape-appsignal.png?branch=master)](http://travis-ci.org/aai/grape-appsignal)
|
6
6
|
|
@@ -8,7 +8,7 @@ AppSignal intergation for [Grape][0], based on code from these [NewRelic][1] and
|
|
8
8
|
|
9
9
|
Add this line to your application's Gemfile:
|
10
10
|
|
11
|
-
gem 'grape-appsignal'
|
11
|
+
gem 'grape-appsignal', '~> 0.1.1'
|
12
12
|
|
13
13
|
Or install:
|
14
14
|
|
@@ -17,11 +17,17 @@ Or install:
|
|
17
17
|
Include it in your Grape API like this
|
18
18
|
|
19
19
|
class TestAPI < Grape::API
|
20
|
+
# Make sure this is at the top of the class.
|
21
|
+
# If you are mounting other APIs it only needs to go into the base API
|
20
22
|
use Appsignal::Grape::Middleware
|
21
23
|
|
24
|
+
helpers Helpers
|
25
|
+
mount ProfileAPI
|
26
|
+
|
22
27
|
get 'hello' do
|
23
28
|
"Hello World"
|
24
29
|
end
|
30
|
+
|
25
31
|
end
|
26
32
|
|
27
33
|
*Make sure you have already setup AppSignal for your app!*
|
@@ -34,6 +40,7 @@ Include it in your Grape API like this
|
|
34
40
|
4. Push to the branch (`git push origin my-new-feature`)
|
35
41
|
5. Make a pull request
|
36
42
|
|
37
|
-
[0]: https://
|
38
|
-
[1]: https://github.com/
|
39
|
-
[2]: https://github.com/
|
43
|
+
[0]: https://appsignal.com
|
44
|
+
[1]: https://github.com/intridea/grape
|
45
|
+
[2]: https://github.com/flyerhzm/newrelic-grape
|
46
|
+
[3]: https://github.com/seanmoon/grape-librato
|
@@ -14,7 +14,7 @@ module Appsignal
|
|
14
14
|
request_path = env['api.endpoint'].routes.first.route_path[1..-1].gsub(/\(\.:format\)\z/, "")
|
15
15
|
|
16
16
|
metric_name = "process_action.grape#{metric_path}"
|
17
|
-
action = "#{method}#{
|
17
|
+
action = "#{method}#{env['PATH_INFO']}"
|
18
18
|
|
19
19
|
ActiveSupport::Notifications.instrument(metric_name, { method: method, path: request_path, action: action, class: "API" } ) do |payload|
|
20
20
|
@app.call(env)
|
@@ -31,7 +31,7 @@ describe Appsignal::Grape::Middleware do
|
|
31
31
|
end
|
32
32
|
|
33
33
|
it do
|
34
|
-
should == { method: "GET" , path: "api/:version/hello/:name", action: "GET
|
34
|
+
should == { method: "GET" , path: "api/:version/hello/:name", action: "GET/api/v1/hello/mark", class: "API"}
|
35
35
|
end
|
36
36
|
|
37
37
|
context "verify the api request" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grape-appsignal
|
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
|
- Mark Madsen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: appsignal
|