アプリケーションの ヘルス やレポーティングの状態を調べるには、New Relic REST API から利用できる サマリーデータ を使用します。
ステータス出力例
アプリケーションの サマリー情報 を取得するために説明した方法を使用すると、出力は以下のようになります。
{ "applications": [ { "id": 1129082, "name": "My Web Page", "language": "java", "health_status": "green", "reporting": true, "last_reported_at": "2014-07-29T23:45:07+00:00", "application_summary": { "response_time": 304, "throughput": 4570, "error_rate": 0.0016, "apdex_target": 523, "apdex_score": 0.97 }, "end_user_summary": { "response_time": 3.73, "throughput": 0.333, "apdex_target": 0, "apdex_score": 1 }, "settings": { "app_apdex_threshold": 0.5, "end_user_apdex_threshold": 7, "enable_real_user_monitoring": true, "use_server_side_config": true }, "links": { "application_instances": [ 2928655, 3941052, 3940275, 3944066, 3943114, 3943147 ], "alert_policy": 41534, "servers": [], "application_hosts": [ 2927654, 3940051, 3943274, 3943065, 3943513, 3943146 ] } } ]}
報告状況
報告のステータスは、 " 報告": true,
アプリケーションのステータスの一部として返される行によって提供されます。このステータスは、アプリケーションが10分間報告しなかった場合、 false
に変わります。また、ステータスが false
になると、 " last_reported_at":<タイムスタンプ>
にタイムスタンプが入らなくなります。
稼働ステータス
健康状態 は、 " health_status":"green",
ラインがアプリケーションのステータスの一部として返されます。APIで返される色は、UIで表示されるアプリの健康状態インジケータと一致します。
例外: REST APIでは、 オレンジ
の代わりに イエロー
を使用しています。アプリケーションがアラートポリシーに関連付けられていない場合は、 unknown
と表示されます。