This is an example of how to use the New Relic Data API (v2) to get your application's average error rate over a specific time period. This value appears as a percentage above the Error rate chart on your APM Summary page.
To use the API, you need:
- An API key.
- Your New Relic application ID (from the URL that your browser shows from the APM user interface, or from the API Explorer user interface)
Formula
The average percentage appears above the Error rate chart on your app's Summary page. New Relic uses this formula to calculate it:
Application Error Rate = 100 * Errors/all:error_count / (HttpDispatcher:call_count + OtherTransaction/all:call_count)
Here is an example of the Error rate chart that appears on your app's APM Summary page.
APM > (selected app) > Monitoring > Summary: You can use the New Relic REST API v2 to return the average error rate percentage that appears on your app's APM Summary page.
API commands
To obtain the metric timeslice values, use the following three commands. This example uses the same time period for each command, and they are all summarized.
To obtain the error count:
To get the HttpDispatcher call count (web application):
To get the OtherTransaction call count (non-web app):
その他のヘルプ
さらに支援が必要な場合は、これらのサポートと学習リソースを確認してください:
- Explorers Hubでは、コミュニティからのサポートを受けたり、ディスカッションに参加したりすることができます。
- 当社サイトで答えを見つけて、サポートポータルの使用方法を確認してください。
- Linux、Windows、およびmacOS向けトラブルシューティングツールであるNew Relic Diagnosticsを実行してください。
- New Relicの とandドキュメント をご確認ください。