typescript decorators for new relic monitoring
npm install newrelic-decoratorsnpm i newrelic-decorators
typescript
@NewRelicTransaction("/notification/test")
async someMethod(){
console.log("something...");
}
`
$3
Add decorator NewRelicRecordMetric for trigger new record metric. Record metric is used to create a new custom metric.
`typescript
@NewRelicRecordMetric("cart", "chargeAmount", 100)
async someMethod(){
console.log("something...");
}
`
$3
Add decorator NewRelicIncrementMetric for trigger new increment metric. Increment metric is used to update the value of a custom metric.
`typescript
@NewRelicIncrementMetric("page", "pageViews", 1)
async someMethod(){
console.log("something...");
}
`
$3
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.
`typescript
@NewRelicEvent("customEvent", {"event": 1})
async someMethod(){
console.log("something...");
}
``