• This repository has been archived on 25/Aug/2020
  • Stars
    star
    119
  • Rank 297,930 (Top 6 %)
  • Language
    Ruby
  • License
    MIT License
  • Created almost 12 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

newrelic instrument for grape

NewRelic::Grape

NewRelic has already officially support grape, see more here

Build Status

NewRelic instrumentation for the Grape API DSL, inspired by this blog post.

If you use newrelic_rpm < 3.9.0, please use newrelic-grape 1.4.x If you use newrelic_rpm >= 3.9.0, please use newrelic-grape >= 2.0.0

Please note: newrelic_rpm 3.9.8 is incompatible! A fix was included in 3.9.9.

Installation

Add this line to your application's Gemfile:

gem 'newrelic-grape'

And then execute:

$ bundle

Or install it yourself as:

$ gem install newrelic-grape

If you're using Rails, make sure that you've told rack to start the agent for Grape:

# config.ru
require ::File.expand_path('../config/environment',  __FILE__)

# You need to manually start the agent
NewRelic::Agent.manual_start

run YourApplication::Application

Usage

Ensure that you have working NewRelic instrumentation. Add the newrelic-grape gem. That's it.

Disabling Instrumentation

Set disable_grape in newrelic.yml or ENV['DISABLE_NEW_RELIC_GRAPE'] to disable instrumentation.

Testing

This gem naturally works in NewRelic developer mode. For more information see the NewRelic Developer Documentation.

To ensure instrumentation in tests, check that perform_action_with_newrelic_trace is invoked on an instance of NewRelic::Agent::Instrumentation::Grape when calling your API.

RSpec

describe NewRelic::Agent::Instrumentation::Grape do
  it "traces" do
    NewRelic::Agent::Instrumentation::Grape
      .any_instance
      .should_receive(:perform_action_with_newrelic_trace)
      .and_yield
    get "/ping"
    response.status.should == 200
  end
end

Demos

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Update CHANGELOG.md describing your changes
  4. Commit your changes (git commit -am 'Add some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create new Pull Request

More Repositories

1

synvert-ruby

write snippet code to rewrite your project code
Ruby
678
star
2

synvert-snippets-ruby

write snippet code to rewrite your project code
Ruby
94
star
3

openfire-apns-plugin

openfire-apns-plugin is used to integrate Apple Push Notification Service to Openfire.
Java
57
star
4

synvert-core-ruby

write snippet code to rewrite your project code
Ruby
44
star
5

newrelic-rake

NewRelic instrument for rake task
Ruby
29
star
6

rubocop-config-prettier

Turns off all rules that are unnecessary or might conflict with prettier plugin ruby
Ruby
21
star
7

simple_paginate

Simple pagination solution for previous and next page navigation
Ruby
20
star
8

node-query-ruby

It defines a NQL (node query language) and node rules to query AST nodes.
Ruby
9
star
9

rails-performance-tips-code

Ruby
7
star
10

rubocop-config-rufo

Turns off all rubocop cops that are unnecessary or might conflict with rufo.
Ruby
6
star
11

synvert

write snippet code to rewrite your source code.
5
star
12

node-mutation-ruby

It provides a set of APIs to rewrite AST node source code.
Ruby
4
star
13

synvert-javascript

write snippet code to rewrite your project code
TypeScript
4
star
14

synvert-playground

synvert playground
TypeScript
2
star
15

SerializedUser

Serialize user with NSUserDefaults and save sensitive token with SSKeychain
Objective-C
2
star
16

synvert-snippets-javascript

write snippet code to rewrite your project code
JavaScript
2
star
17

parser_node_ext

extend parser node, add parent and sibling, assign names to the child nodes.
Ruby
2
star
18

node-query-javascript

It defines a NQL (node query language) and node rules to query AST nodes.
TypeScript
2
star
19

guard-bower_rails

Ruby
2
star
20

node-mutation-javascript

It provides a set of APIs to rewrite AST node source code.
TypeScript
2
star
21

synvert-tools

Ruby
2
star
22

rails-performance-tips-au

Rails Performance Tips
JavaScript
1
star
23

synvert-core-javascript

write snippet code to rewrite your project code
TypeScript
1
star
24

awesomecode-synvert-ruby

Shell
1
star
25

blog.xinminlabs.com

http://blog.xinminlabs.com
HTML
1
star
26

synvert-vscode-extension

synvert vscode extension
TypeScript
1
star
27

synvert-gui

JavaScript
1
star
28

syntax_tree_ext

extend syntax_tree, add parent and sibling
Ruby
1
star
29

synvert-api-javascript

TypeScript
1
star
30

acts_as_viewable

Make models to be viewable
Ruby
1
star
31

synvert-ui-common

common methods for synvert ui (GUI, vscode extension and web)
TypeScript
1
star
32

prism_ext

prism ext
Ruby
1
star