Skip to content

pavlikm/newrelic-decorators

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NewRelic Decorators

Installation:

  1. install New Relic Agent:

    https://docs.newrelic.com/docs/apm/agents/nodejs-agent/installation-configuration/install-nodejs-agent/

  2. npm i newrelic-decorators

Usage:

NewRelicTransaction

Add decorator NewRelicTransaction for trigger transaction into New Relic dashboard. If transaction as param is not provided, the name of method will be used.

@NewRelicTransaction("/notification/test")
async someMethod(){
    console.log("something...");
}

NewRelicRecordMetric

Add decorator NewRelicRecordMetric for trigger new record metric. Record metric is used to create a new custom metric.

@NewRelicRecordMetric("cart", "chargeAmount", 100)
async someMethod(){
    console.log("something...");
}

NewRelicIncrementMetric

Add decorator NewRelicIncrementMetric for trigger new increment metric. Increment metric is used to update the value of a custom metric.

@NewRelicIncrementMetric("page", "pageViews", 1)
async someMethod(){
    console.log("something...");
}

NewRelicEvent

Add decorator NewRelicEvent for trigger new event. The attributes must be an object of key and value pairs. The keys must be string, and the values must be string, number, or boolean.

@NewRelicEvent("customEvent", {"event": 1})
async someMethod(){
    console.log("something...");
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published