newrelic-praxis 1.0 → 1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +5 -5
- data/lib/newrelic-praxis/instrumentation/praxis.rb +2 -0
- data/lib/newrelic-praxis/praxis/request_subscriber.rb +26 -0
- data/lib/newrelic-praxis/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b54e0598f6b64e25edbb03123cb78f14186f031
|
4
|
+
data.tar.gz: 9cf97034d5ac1c52a55c977fff6e38ca650d1bf6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abd72021c5171312e1fd58311ca03d4ca8f70301b3d57794d2b99bfa5ea89771d774a69d8dff000406442f52638cd75630188393716fda9556dbdceae54d5f35
|
7
|
+
data.tar.gz: b86822180eb6774e8f8677eabbed836d44db6307e592f4b145b01514a715c741e8815815145e148b0517a3b262cdcb9cd056a72b4dd942d91096c040c467824e
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -11,14 +11,14 @@ Add the gem to your Gemfile:
|
|
11
11
|
gem 'newrelic-praxis'
|
12
12
|
```
|
13
13
|
|
14
|
-
|
14
|
+
Make sure you require the gem before calling `Praxis::Application.instance.setup`. For example, using a simple `config.ru` file like this one:
|
15
15
|
|
16
|
-
For example, you could use a simple initializer like `config/initializers/init_newrelic.rb`:
|
17
16
|
```ruby
|
18
|
-
|
19
|
-
|
17
|
+
ENV['RACK_ENV'] ||= 'development'
|
18
|
+
Bundler.setup(:default, ENV['RACK_ENV'])
|
19
|
+
Bundler.require(:default, ENV['RACK_ENV'])
|
20
20
|
|
21
|
-
|
21
|
+
run Praxis::Application.instance.setup
|
22
22
|
```
|
23
23
|
|
24
24
|
## What Is Instrumented
|
@@ -15,8 +15,10 @@ DependencyDetection.defer do
|
|
15
15
|
|
16
16
|
executes do
|
17
17
|
require 'newrelic-praxis/praxis/action_event'
|
18
|
+
require 'newrelic-praxis/praxis/request_subscriber'
|
18
19
|
require 'newrelic-praxis/praxis/action_subscriber'
|
19
20
|
|
21
|
+
NewRelic::Agent::Instrumentation::Praxis::RequestSubscriber.subscribe 'praxis.request.all'.freeze
|
20
22
|
NewRelic::Agent::Instrumentation::Praxis::ActionSubscriber.subscribe 'praxis.request_stage.execute'.freeze
|
21
23
|
end
|
22
24
|
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module NewRelic
|
2
|
+
module Agent
|
3
|
+
module Instrumentation
|
4
|
+
module Praxis
|
5
|
+
|
6
|
+
class RequestSubscriber < EventedSubscriber
|
7
|
+
|
8
|
+
def start(name, id, payload) #THREAD_LOCAL_ACCESS
|
9
|
+
|
10
|
+
action = payload[:request].action
|
11
|
+
controller = action.resource_definition.controller
|
12
|
+
metric_name = "Controller/#{controller.name}/#{action.name}"
|
13
|
+
current = NewRelic::Agent::Transaction.tl_current
|
14
|
+
current.set_overriding_transaction_name(metric_name, nil)
|
15
|
+
rescue => e
|
16
|
+
log_notification_error(e, name, 'start')
|
17
|
+
end
|
18
|
+
|
19
|
+
def finish(name, id, payload)
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: newrelic-praxis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.1'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josep M. Blanquer
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-09-
|
12
|
+
date: 2015-09-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: praxis
|
@@ -129,6 +129,7 @@ files:
|
|
129
129
|
- lib/newrelic-praxis/instrumentation/praxis_mapper.rb
|
130
130
|
- lib/newrelic-praxis/praxis/action_event.rb
|
131
131
|
- lib/newrelic-praxis/praxis/action_subscriber.rb
|
132
|
+
- lib/newrelic-praxis/praxis/request_subscriber.rb
|
132
133
|
- lib/newrelic-praxis/praxis_blueprints/render_event.rb
|
133
134
|
- lib/newrelic-praxis/praxis_blueprints/render_subscriber.rb
|
134
135
|
- lib/newrelic-praxis/praxis_mapper/finalize_subscriber.rb
|