New Relic ダッシュボード

概要

New Relic に接続して、以下のことができます。

  • New Relic の主要メトリクス (応答時間、Apdex スコアなど) を Datadog の他のメトリクスと関連付けて表示できます。
    (New Relic Pro 以上のアカウントで利用可能)
  • イベントストリームに New Relic アラートを表示します。

セットアップ

インストール

イベントストリームへの New Relic アラートの表示

  1. “Alerts & AI” タブで “Notificaton Channels” に移動します。

  2. “New Notification Channel” を選択します。

  3. チャンネルタイプとして “Webhook” を選択します。

  4. チャンネルを “Datadog” と名付けます。

  5. このベース URL を入力します:

    https://app.datadoghq.com/intake/webhook/newrelic?api_key=<DATADOG_API_KEY>
    
  6. “Custom Payload” をクリックし、ペイロードが JSON 形式であることを確認します。 注: カスタムタグを JSON で設定する手順については、次のセクションを参照してください。

  7. “Create Channel” をクリックします。

  8. “Alert Policies” をクリックします。

  9. Datadog に送信したいアラートについて、アラートポリシーを選択します。

New Relic APM メトリクスの収集

  1. New Relic の API キーページで REST API キーを見つけ (Account Settings -> Integrations -> API Keys)、Datadog New Relic Integration ページのフォームに入力します。
  2. すべてのメトリクスに New Relic アカウント番号をタグ付けするには、アカウントタグを追加します。
  3. ホストごとにメトリクスを収集するか、アプリ全体で収集するかを選択します。 : このオプションを有効にすると、New Relic ホストが Datadog にインポートされます。
New Relic のカスタムメトリクスが Datadog に表示されるまで 5~10 分かかることがあります。
最初の 5000 個までのカスタムメトリクスを自動コンプリートに使用できます。

収集データ

メトリクス

new_relic.apdex.score
(gauge)
Ratio of satisfactory response times to unsatisfactory response times
Shown as apdex
new_relic.application_summary.apdex_score
(gauge)
Ratio of satisfactory response times to unsatisfactory response times
Shown as apdex
new_relic.application_summary.apdex_target
(gauge)
Threshold ratio of satisfactory response times to unsatisfactory response times
Shown as apdex
new_relic.application_summary.concurrent_instance_count
(gauge)
Number of concurrent instances serving the application
Shown as instance
new_relic.application_summary.error_rate
(gauge)
Ratio of the number of errors reported by the application to the total number of served requests
Shown as percent
new_relic.application_summary.host_count
(gauge)
Number of hosts serving the application
Shown as host
new_relic.application_summary.instance_count
(gauge)
Number of instances serving the application
Shown as instance
new_relic.application_summary.response_time
(gauge)
Application response time
Shown as millisecond
new_relic.application_summary.throughput
(gauge)
Number of requests served by the application
Shown as request
new_relic.database.all.average_exclusive_time
(gauge)
Average time spent in database queries, exclusive of any time instrumented by other metrics
Shown as millisecond
new_relic.errors.all.errors_per_minute
(gauge)
Number of errors reported by the application
Shown as error
new_relic.web_transaction.average_response_time
(gauge)
Average response time of web transactions served by the application
Shown as second
new_relic.web_transaction.requests_per_minute
(gauge)
Number of web transaction requests served by the application
Shown as request
new_relic.synthetics_summary.monitors.count
(gauge)
Count of monitors
Shown as monitor
new_relic.synthetics_summary.monitors.frequency
(gauge)
Frequency of the monitor
Shown as minute
new_relic.synthetics_summary.locations.count
(gauge)
Count of locations associated with the monitor
Shown as location
new_relic.synthetic_check.duration
(gauge)
Total time for the monitor run
Shown as millisecond
new_relic.synthetic_check.total_request_body_size
(gauge)
Size of the body request to the server
Shown as byte
new_relic.synthetic_check.total_request_header_size
(gauge)
Size of the header request to the server
Shown as byte
new_relic.synthetic_check.total_response_header_size
(gauge)
Size of the response header returned by the server
Shown as byte
new_relic.synthetic_check.total_response_body_size
(gauge)
Size of the response body returned by the server
Shown as byte
new_relic.synthetic_check.count
(count)
Count of monitor runs (use result tag to select only successes or failures)
Shown as check
new_relic.synthetic_check.errors
(count)
Count of individual request errors (not check failures)
Shown as error
new_relic.synthetic_request.count
(count)
Count of requests
Shown as request
new_relic.synthetic_request.duration_blocked.average
(gauge)
Average time the requests were blocked
Shown as millisecond
new_relic.synthetic_request.duration_connect.average
(gauge)
Average time the requests were establishing a connection
Shown as millisecond
new_relic.synthetic_request.duration_dns.average
(gauge)
Average time the requests were resolving DNS
Shown as millisecond
new_relic.synthetic_request.duration_receive.average
(gauge)
Average time the requests were receiving data
Shown as millisecond
new_relic.synthetic_request.duration_send.average
(gauge)
Average time the requests were sending data
Shown as millisecond
new_relic.synthetic_request.duration_ssl.average
(gauge)
Average time establishing an SSL connection
Shown as millisecond
new_relic.synthetic_request.duration_wait.average
(gauge)
Average time the requests were waiting
Shown as millisecond
new_relic.synthetic_request.resources_load_time
(gauge)
Average resources load time
Shown as millisecond
new_relic.synthetic_request.time_spent_third_parties
(gauge)
Average time spent by third parties
Shown as millisecond
new_relic.apm_mobile.mobile_application_summary.active_users
(gauge)
The number of active users for a mobile application
Shown as user
new_relic.apm_mobile.mobile_application_summary.launch_count
(count)
The number of mobile applications launched
Shown as execution
new_relic.apm_mobile.mobile_application_summary.throughput
(gauge)
Throughput for a mobile application
Shown as request
new_relic.apm_mobile.mobile_application_summary.response_time
(gauge)
Mobile application response time
Shown as millisecond
new_relic.apm_mobile.mobile_application_summary.calls_per_session
(gauge)
Number of calls per session
Shown as invocation
new_relic.apm_mobile.mobile_application_summary.interaction_time
(gauge)
Interaction time for a mobile application
Shown as millisecond
new_relic.apm_mobile.mobile_application_summary.failed_call_rate
(gauge)
Percentage of failed calls for a mobile application
Shown as percent
new_relic.apm_mobile.mobile_application_summary.remote_error_rate
(gauge)
Percentage of remote error for a mobile application
Shown as percent
new_relic.apm_mobile.mobile_application_summary.unresolved_crash_count
(count)
Number of unresolved crash count for a mobile application
Shown as execution
new_relic.apm_mobile.mobile_application_summary.crash_count
(count)
Crash count for a mobile application
Shown as execution
new_relic.apm_mobile.mobile_application_summary.crash_rate
(gauge)
Crash rate for a mobile application
Shown as percent
new_relic.apm_mobile.mobile.crash.all.call_count
(count)
Total numbers of crashed calls
Shown as execution
new_relic.apm_mobile.session.start.call_count
(count)
Number of started calls for a session
Shown as invocation
new_relic.apm_mobile.mobile.failed_call_rate.call_count
(count)
Failed call rate count for a mobile application
Shown as invocation
new_relic.apm_mobile.session.duration.call_count
(count)
Number of call counts for a session
Shown as invocation
new_relic.apm_mobile.cpu.user.utilization.percent
(gauge)
User space CPU usage utilization
Shown as percent
new_relic.apm_mobile.cpu.system.utilization.percent
(gauge)
Kernel space CPU usage utilization
Shown as percent
new_relic.web_transaction_total_time.average_response_time
(gauge)
Average response time of web transactions served by the application
Shown as second
new_relic.web_transaction_total_time.requests_per_minute
(gauge)
Number of web transaction requests served by the application
Shown as request
new_relic.web_transaction_total_time.calls_per_minute
(gauge)
Number of calls served by the application
Shown as invocation
new_relic.web_transaction_total_time.min_response_time
(gauge)
Minimum response time of web transactions served by the application
Shown as second
new_relic.web_transaction_total_time.max_response_time
(gauge)
Maximum response time of web transactions served by the application
Shown as second
new_relic.web_transaction_total_time.total_call_time_per_minute
(gauge)
Total time, in second per minute, spent in web application transactions
Shown as fraction
new_relic.web_transaction_total_time.standard_deviation
(gauge)
Standard deviation of the response time of web transactions served by the application
Shown as second
new_relic.web_transaction_total_time.average_exclusive_time
(gauge)
Average time spent in web application transactions, exclusive of any time instrumented by other metrics
Shown as millisecond
new_relic.web_transaction_total_time.average_value
(gauge)
Average response time over all instances in the call count
Shown as second

イベント

New Relic インテグレーションはイベントストリームで New Relic アラートを取り込みます。

サービスのチェック

New Relic インテグレーションには、サービスのチェック機能は含まれません。

トラブルシューティング

ホストによるメトリクスの収集

‘Collect metrics by host’ (ホストによるメトリクスの収集) を設定すると、Datadog は、ホストスループットベースの全体平均ではなく、関連するホストごとにアプリケーションメトリクスを収集します。

たとえば、次のようにメトリクスを別々に使用すると、状況を理解できます。「ホスト X のエラー率 Y は異常で問題があるが、多数のホストでアプリケーション Z の全体的なエラー率を集計すると許容範囲である。」

このオプションを設定した場合も、New Relic ホストが Datadog Infrastructure セクションにインポートされます。

New Relic と Datadog における値の違い

New Relic は、ホストレベルで測定されたメトリクス (例えば応答時間) についてアプリケーションレベルの集計値を計算する際、各ホストのスループットの測定値を基に加重平均を計算します。

Datadog で最も近い値は算術平均を計算する avg 集計関数です。これはデフォルトの集計関数でもあり、最も単純なクエリの結果と同じです (例: new_relic.web_transaction.average_response_time{*})。すべてのホストのスループットがほぼ同じであれば、Datadog の平均集計値と New Relic のスループットに基づく加重集計値は同様の数値になりますが、スループットが不均一な場合、表示されるアプリケーションレベルの集計値は New Relic と Datadog で異なります。

たとえば、3 つのホストを持つアプリケーションがあるとします。 ある時点で、各ホストは次の値を持ちます。

              スループット    応答時間
hostA         305 rpm           240 ms
hostB         310 rpm           250 ms
hostC          30 rpm            50 ms

New Relic は、アプリケーションレベルの応答時間を次のように計算します。

hostA: 240 ms x 305 rpm = 73200 合計時間
hostB: 250 ms x 310 rpm = 77500 合計時間
hostC:  50 ms x 30 rpm =  1500 合計時間

合計スループット = 305 + 310 + 30 = 645 rpm
平均応答時間 = (73200 + 77500 + 1500) ÷ 645 = 236.0 ms

一方、Datadog は単に算術平均を計算します。

平均応答時間 = (240 + 250 + 50) ÷ 3 = 180.0 ms

ベータアラートにカスタムタグを含める

New Relic のベータアラート機能の “Use Custom Payload” オプションで、カスタムタグを含めることができます。これを構成するには、New Relic アカウントに移動し、画面の右上にある ‘Alerts Beta’ ボタンをクリックします。そして、‘Notification channels’ セクションを選択し、Datadog に対して設定した Webhook を見つけます。ここに ‘Use Custom Payload’ というセクションがあります。これを選択すると、JSON ペイロードが表示されます。このペイロードを変更して、“tags” 属性を追加する必要があります。たとえば、変更後のペイロードは次のようになります。

{
    "account_id": "$ACCOUNT_ID",
    "account_name": "$ACCOUNT_NAME",
    "condition_id": "$CONDITION_ID",
    "condition_name": "$CONDITION_NAME",
    "current_state": "$EVENT_STATE",
    "details": "$EVENT_DETAILS",
    "event_type": "$EVENT_TYPE",
    "incident_acknowledge_url": "$INCIDENT_ACKNOWLEDGE_URL",
    "incident_id": "$INCIDENT_ID",
    "incident_url": "$INCIDENT_URL",
    "owner": "$EVENT_OWNER",
    "policy_name": "$POLICY_NAME",
    "policy_url": "$POLICY_URL",
    "runbook_url": "$RUNBOOK_URL",
    "severity": "$SEVERITY",
    "targets": "$TARGETS",
    "timestamp": "$TIMESTAMP",
    "tags": ["application:yourapplication", "host:yourhostname", "sometag"]
}

変更を完了したら、必ず ‘Update Chanel’ を選択して変更を保存します。