• /
  • ログイン
  • 無料アカウント

Node.js custom metrics

Record arbitrary performance data via an API call (for example, timing or computer resource data). Use the data explorer 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 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:

Example custom metric

Here is an example that shows how you can use metrics to track currency flowing through a site:

app.post('/cart/checkout', function(req, res) {
var total = computeCartTotal(req.user);
newrelic.recordMetric('Cart/ChargeAmount', total);
...
});

View custom metrics

To view custom metrics, use the data explorer to search metrics, create customizable charts, and add those charts to New Relic dashboards.

その他のヘルプ

さらに支援が必要な場合は、これらのサポートと学習リソースを確認してください:

問題を作成するこのページを編集する
Copyright © 2020 New Relic Inc.