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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9d41c5e9b007c877cda2b88973c6a5ea76d93d42
4
- data.tar.gz: cda91b0f9bfc6a08d77582971ec752ac55b4f3eb
3
+ metadata.gz: 4b54e0598f6b64e25edbb03123cb78f14186f031
4
+ data.tar.gz: 9cf97034d5ac1c52a55c977fff6e38ca650d1bf6
5
5
  SHA512:
6
- metadata.gz: 787db604f4dfc0b2b7b27044422aa479bdce66dfc7515f8978b89cc0497d92a98f2e5846a585c61aaf0d0fe286d73951f2a54d75b1bb151f26d3ea8966499733
7
- data.tar.gz: e55d5598f6c32a433489567055b12f66988f05702fa4dfcba8dc4b42eec9babdb3a950af279400d3fb1363a1f62f229cb0e7ab5e17e021fe538b9c8875c1bd48
6
+ metadata.gz: abd72021c5171312e1fd58311ca03d4ca8f70301b3d57794d2b99bfa5ea89771d774a69d8dff000406442f52638cd75630188393716fda9556dbdceae54d5f35
7
+ data.tar.gz: b86822180eb6774e8f8677eabbed836d44db6307e592f4b145b01514a715c741e8815815145e148b0517a3b262cdcb9cd056a72b4dd942d91096c040c467824e
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## next
4
4
 
5
+ ## 1.1
6
+
7
+ * Ensure every transaction is named after the Ctrl+action (even if it never hits the controller action code)
8
+
5
9
  ## 1.0
6
10
 
7
11
  * Initial release of the Gem:
data/README.md CHANGED
@@ -11,14 +11,14 @@ Add the gem to your Gemfile:
11
11
  gem 'newrelic-praxis'
12
12
  ```
13
13
 
14
- Require the gem and start the New Relic agent normally.
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
- require 'newrelic_rpm'
19
- require 'newrelic-praxis'
17
+ ENV['RACK_ENV'] ||= 'development'
18
+ Bundler.setup(:default, ENV['RACK_ENV'])
19
+ Bundler.require(:default, ENV['RACK_ENV'])
20
20
 
21
- NewRelic::Agent.manual_start
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
@@ -1,5 +1,5 @@
1
1
  module Praxis
2
2
  module NewRelic
3
- VERSION = "1.0"
3
+ VERSION = "1.1"
4
4
  end
5
5
  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.0'
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-18 00:00:00.000000000 Z
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