Record arbitrary performance data via an API call, for example, timing or computer resource data. Use metrics and events to search your custom metrics, create customizable charts, and add those charts to New Relic dashboards. Using custom metrics unifies your monitoring inside New Relic.
주의
Collecting too many metrics can impact the performance of your application and your New Relic agent. To avoid data problems, keep the total number of unique custom metrics under 2000.
Name your metrics
Metric names are paths delimited by the /
character. For custom metrics use this pattern:
<category>/<class>/<method>
For custom metric names, use <class>/<method>
or <category>/<name>
. For example, use MyCategory/My_method
).
중요
For versions prior to Node.js agent v5, you need to prepend your metrics with Custom/
. The agent will not automatically prepend custom metrics with this to prevent collision with internal metrics.
Record custom metrics
The public API for recording metric data consists of two methods on newrelic
:
recordMetric
: Use to create a new custom metric.incrementMetric
: Use to update the value of a custom metric.
For more information, see the example application on GitHub.