1.2.9 • Published 1 year ago

newrelic-decorators v1.2.9

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

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...");
}
1.2.9

1 year ago

1.2.8

1 year ago

1.2.7

1 year ago

1.2.6

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago