このページは、あなたとあなたのチームが問題やインシデントについてデータを照会し、NerdGraph API を使用して機能を構成する方法を学習する場所です。
主なデータ型はIssue TypeとIncident Typeの 2 つです。
問題の種類
New Relic のデータ型の詳細については、こちらをご覧ください。
名前  | タイプ  | 説明  | 
|---|---|---|
  | [イン!]!  | アカウント ID のリスト。問題は、他のアカウントの他の問題と関連付けられる可能性があるためです。  | 
  | エポックミリ秒  | 問題が認識された時間。  | 
  | 弦  | 問題を認識したユーザー。  | 
  | エポックミリ秒  | 問題がアクティブ化された時間: createdAt + gracePeriod。  | 
  | エポックミリ秒  | 問題がクローズされた時間。  | 
  | 弦  | 問題を手動でクローズしたユーザー。  | 
  | エポックミリ秒  | 問題が作成された時間。  | 
  | [弦!]!  | インシデントの説明のリスト。  | 
  | [エンティティガイド!]  | 一意のエンティティ識別子のリスト。  | 
  | [弦!]  | エンティティ名のリスト。  | 
  | [弦!]  | エンティティ タイプのリスト。  | 
  | [イン!]!  | 環境について詳しくは、 アラートの概要を参照してください。  | 
  | 弦!  | 
  | 
  | [弦!]  | この号のインシデント ID のリスト。場合によっては、問題に数千のインシデントが含まれる場合があります。  | 
  | ブール!  | True は、他の問題がこの問題に関連していたことを意味します。  | 
  | ブール!  | アイドル状態の問題については、ドキュメントを参照してください。  | 
  | ID!  | 問題識別子。  | 
  | [弦!]!  | インシデント、異常、外部などのインシデントの原因のリスト。  | 
  | 優先順位!  | 問題の優先度。  | 
  | [弦!]!  | newrelic や external などのインシデントのソースのリスト。  | 
  | 問題状態!  | 問題の状態は  | 
  | [弦!]!  | 基になるインシデント タイトルのリスト。  | 
  | イント!  | 基になるインシデントの数。  | 
  | エポックミリ秒!  | 問題が最後に更新された時刻。  | 
問題のライフサイクルと状態
アイドル状態の問題:
- 課題が大きすぎる場合、つまり 5000 件以上のインシデントが含まれている場合、課題はアイドル状態になる可能性があります。
 - アイドル状態の問題は、それ以上のインシデントを受け入れません。
 - アイドル状態の問題は、他の問題と相関しません。
 
インシデントの種類
フィールド  | タイプ  | 説明  | 
|---|---|---|
  | 弦  | このインシデントが保存されているアカウント ID。  | 
  | エポックミリ秒  | インシデントがクローズされた時刻。  | 
  | エポックミリ秒  | インシデントが作成された時刻。  | 
  | 弦  | 説明は、ポリシー名と条件名から生成されるか、API を介して提供されます。  | 
  | EntityGuid  | 一意のエンティティ識別子。  | 
  | 弦  | エンティティ名。  | 
  | 弦  | エンティティ タイプ。  | 
  | イント!  | 環境について学ぶには、 ドキュメントを参照してください。  | 
  | ID  | インシデント識別子。  | 
  | 優先度  | インシデント優先度。  | 
  | インシデント状態。  | インシデント状態。  | 
  | エポックミリ秒  | インシデント イベントのタイムスタンプ。  | 
  | 弦  | ユーザーが条件に付けた説明 (提供されている場合)。  | 
  | エポックミリ秒  | インシデントが最後に更新された時刻。  | 
  | オプション  | このインシデントが New Relic の異常に起因する場合は、異常 ID があります。  | 
  | オプション  | 条件ID  | 
  | 弦  | このインシデントを生成したポリシーの ID。  | 
  | [KeyValue!]  | このインシデントに関連するタグの集約。  | 
問題の一覧表示とフィルター処理
issuesクエリを使用すると、アカウントごとにすべての問題をページ分割できます。また、問題に対するフィルタリング機能も使用できます。
フィルタリング データを指定しない場合、過去 24 時間の問題データが取得されます。
リクエスト
{  actor {    account(id: ACCOUNT_ID) {      aiIssues {        issues {          issues {            issueId            priority            state            title          }        }      }    }  }}結果
{  "data": {    "actor": {      "account": {        "aiIssues": {          "issues": {            "issues": [              {                "issueId": "f0668430-60c4-4bfd-8188-fcbeefb1d5ca",                "priority": "CRITICAL",                "state": "CREATED",                "title": [                  "NrAiIncident query result is > 30.0 for 1 minutes on 'ROI test for photon with checkbox'"                ]              },              {                "issueId": "12427573-fe89-4be1-9411-30158e0a9874",                "priority": "MEDIUM",                "state": "CLOSED",                "title": [                  "Anomaly: It was different from normal"                ]              },              {                "issueId": "2b3fcffe-5330-4766-bc51-392b6db5eedc",                "priority": "MEDIUM",                "state": "CLOSED",                "title": [                  "Anomaly: It was different from normal"                ]              },ページネーションを通じて返される問題の最大数は NRQL LIMIT MAXによって設定され、この制限を超えるとフィルタリングが必要になることに注意してください。
最初のリクエスト
{  actor {    account(id: YOUR_ACCOUNT_ID) {      aiIssues {        issues(cursor: "") {          issues {            issueId            priority            state            title          }          nextCursor        }      }    }  }}初期結果
{  "data": {    "actor": {      "account": {        "aiIssues": {          "issues": {            "issues": [              {                "issueId": "bda33b52-c70b-47b9-abe3-9e859a394037",                "priority": "CRITICAL",                "state": "ACTIVATED",                "title": [                  "Signal lost for 5 minutes on 'Percent All Facet'"                ]              },              {                "issueId": "242c713c-7654-491c-808e-3aa7fc44812b",                "priority": "MEDIUM",                "state": "CREATED",                "title": [                  "Anomaly: Non-web throughput"                ]              },              {                "issueId": "f19c9803-fb24-4d5d-9c35-16f659bceb3a",                "priority": "MEDIUM",                "state": "CLOSED",                "title": [                  "Anomaly: Error rate"                ]              }            ],            "nextCursor": "=ATN"          }        }      }    }  },次に、後続のリクエストで、 nextCursorが空になるまで、 nextCursorの前の返信からのカーソル値を提供します。
後続のリクエストは次のようになります。
{  actor {    account(id: YOUR_ACCOUNT_ID) {      aiIssues {        issues(cursor: "=ATN") {          issues {            issueId            priority            state            title          }          nextCursor        }      }    }  }}エンティティ GUID、エンティティ タイプ、問題の優先度、問題の状態、またはこれらの属性の任意の組み合わせで問題をフィルタリングします。
"Filter issues"input FilterIssues {  "entityGuids"  entityGuids: [EntityGuid!]  "entityTypes"  entityTypes: [String!]  "ids"  ids: [ID!]  "priority"  priority: [String!]  "states"  states: [IssueState!]}ここで、 entityGuidesとentityTypesは、New Relic エンティティについて学ぶページで定義されているエンティティ属性です。
- 問題の優先度は次のいずれかになります: 
LOW、MEDIUM、HIGH、CRITICAL - 問題の状態は次のいずれかです: 
CREATED、ACTIVATED、DEACTIVATED、CLOSED timeWindowEpochMilliseconds 形式の開始時間と終了時間。指定されていない場合、デフォルト値は過去 24 時間です。- すでに見たように、 
cursor 
優先度CRITICALと状態CLOSEDの問題を見つけてみましょう:
{  actor {    account(id: YOUR_ACCOUNT_ID) {      aiIssues {        issues(filter: { priority: "CRITICAL", states: CLOSED }) {          issues {            issueId            priority            state            title          }          nextCursor        }      }    }  }}結果
{  "data": {    "actor": {      "account": {        "aiIssues": {          "issues": {            "issues": [              {                "issueId": "5948472b-f7dd-4a6e-aec0-de0390732495",                "priority": "CRITICAL",                "state": "CLOSED",                "title": [                  "team_store_validation_error query result is > 0.0 on 'Team Store Domain Specific Validation Error'"                ]              },              {                "issueId": "570c2770-efd2-4c0f-8dc8-fbc1ae69a4df",                "priority": "CRITICAL",                "state": "CLOSED",                "title": [                  "PageViewTiming query deviated from the baseline at least once in 5 minutes on 'Onyx_check_Mark test'"                ]              },              {                "issueId": "d056be64-829e-4a83-bfb1-e3232eb3a59b",                "priority": "CRITICAL",                "state": "CLOSED",                "title": [                  "Transaction query result is > 2.0 on 'Error fetching commitments (TF)'"                ]              },結果はentityGuidでさらにフィルタリングできます。
{  actor {    account(id: 1) {      aiIssues {        issues(          filter: {            priority: "CRITICAL"            states: CLOSED            entityGuids: [              "MXxBUE18QVBQTElDQVRJT058MzIxNjY2NA"              "MXxBUE18QVBQTElDQVRJT058MzIxNzY1NA"            ]          }        ) {          issues {            entityTypes            entityNames            entityGuids            issueId            priority            state            title          }          nextCursor        }      }    }  }}結果
{  "data": {    "actor": {      "account": {        "aiIssues": {          "issues": {            "issues": [              {                "entityGuids": [                  "MXxBUE18QVBQTElDQVRJT058MzIxNjY2NA",                  "MXxBUE18QVBQTElDQVRJT058MzIxNzY1NA"                ],                "entityNames": [                  "hour-timeslice-writer (eu-production)",                  "metric-timeslice-service (eu-production)"                ],                "entityTypes": [                  "Application"                ],                "issueId": "1a3a0581-aefc-4027-91a0-a941072101c0",                "priority": "CRITICAL",                "state": "CLOSED",                "title": [                  "'Custom/CassandraClient/hour_timeslice_cluster_main/percentile/95th' > 0.5 for at least 5 minutes on 'hour-timeslice-writer (eu-production)'",                  "'Custom/CassandraClient/hour_timeslice_cluster_main/percentile/95th' > 0.5 for at least 5 minutes on 'metric-timeslice-service (eu-production)'"                ]              },              {                "entityGuids": [                  "MXxBUE18QVBQTElDQVRJT058MzIxNzY1NA"                ],                "entityNames": [                  "metric-timeslice-service (eu-production)"                ],                "entityTypes": [                  "Application"                ],                "issueId": "fd5fda9e-6bfe-469a-8cf7-822986401033",                "priority": "CRITICAL",                "state": "CLOSED",                "title": [                  "'Custom/CassandraClient/hour_timeslice_cluster_main/percentile/95th' > 0.5 for at least 5 minutes on 'metric-timeslice-service (eu-production)'"                ]              }            ],            "nextCursor": null          }NerdGraph では、課題 ID でクエリを実行することもできます。
リクエスト
{  actor {    account(id: 1) {      aiIssues {        issues(          filter: {            ids: [              "e506476f-d804-4e5c-92b5-da8db622f10d"              "1bd514d9-2682-4366-8f28-5d742fd000af"            ]          }        ) {          issues {            entityTypes            entityNames            entityGuids            issueId            priority            state            title          }          nextCursor        }      }    }  }}結果
{  "data": {    "actor": {      "account": {        "aiIssues": {          "issues": {            "issues": [              {                "entityGuids": [                  ""                ],                "entityNames": [                  "Metric query"                ],                "entityTypes": [                  "Query"                ],                "issueId": "e506476f-d804-4e5c-92b5-da8db622f10d",                "priority": "CRITICAL",                "state": "CLOSED",                "title": [                  "Metric query result is > 1.4 for 1 minutes on 'Hillel March Demo'"                ]              },              {                "entityGuids": [                  "MXxFWFR8U0VSVklDRXw1ODIzMTc1ODk4Mjc1OTI4Mjk5"                ],                "entityNames": [                  "clm-10"                ],                "entityTypes": [                  "Query"                ],                "issueId": "1bd514d9-2682-4366-8f28-5d742fd000af",                "priority": "CRITICAL",                "state": "CLOSED",                "title": [                  "clm-10 query result is > 30.0 for 7 minutes on 'SPIKE: signal-accumulation-service (production) — Kafka lag'"                ]              }            ],            "nextCursor": null          }        }問題イベントの一覧表示とフィルター処理
issuesEventsクエリを使用すると、アカウントごとにすべての問題イベントをページ分割できます。また、問題イベントのフィルタリング機能も使用できます。
フィルタリング データを指定しない場合、過去 24 時間の問題イベント データが取得されます。
リクエスト
{  actor {    account(id: YOUR_ACCOUNT_ID) {      aiIssues {        issuesEvents {          issues {            issueId            priority            state            title            eventType          }        }      }    }  }}結果
{  "data": {    "actor": {      "account": {        "aiIssues": {          "issuesEvents": {            "issues": [              {                "eventType": "ATTRIBUTES_UPDATED",                "issueId": "e6da1499-cb1c-4522-bb04-6fdb487e8e2b",                "priority": "CRITICAL",                "state": "ACTIVATED",                "title": [                  "notification-request-builder query result is < 10.0 for 1 minutes on 'error logs in nrb'",                  "notification-request-builder query result is > 1600.0 for 5 minutes on 'nrb debug logs'"                ]              },              {                "eventType": "ATTRIBUTES_UPDATED",                "issueId": "e6da1499-cb1c-4522-bb04-6fdb487e8e2b",                "priority": "CRITICAL",                "state": "ACTIVATED",                "title": [                  "notification-request-builder query result is < 10.0 for 1 minutes on 'error logs in nrb'",                  "notification-request-builder query result is > 1600.0 for 5 minutes on 'nrb debug logs'"                ]              },              {                "eventType": "ATTRIBUTES_UPDATED",                "issueId": "e6da1499-cb1c-4522-bb04-6fdb487e8e2b",                "priority": "CRITICAL",                "state": "ACTIVATED",                "title": [                  "notification-request-builder query result is < 10.0 for 1 minutes on 'error logs in nrb'",                  "notification-request-builder query result is > 1600.0 for 5 minutes on 'nrb debug logs'"                ]              },              {                "eventType": "INCIDENT_ADDED",                "issueId": "e6da1499-cb1c-4522-bb04-6fdb487e8e2b",                "priority": "CRITICAL",                "state": "ACTIVATED",                "title": [                  "notification-request-builder query result is < 10.0 for 1 minutes on 'error logs in nrb'",                  "notification-request-builder query result is > 1600.0 for 5 minutes on 'nrb debug logs'"                ]              },entityGuids 、 entityTypes 、問題の優先度、問題の状態、またはこれらの属性の任意の組み合わせで問題イベントをフィルタリングします。
"Filter issues events"input FilterIssuesEvents {  "entityGuids"  entityGuids: [EntityGuid!]  "entityTypes"  entityTypes: [String!]  "ids"  ids: [ID!]}timeWindowEpochMilliseconds形式の開始時間と終了時間。指定しない場合、デフォルト値は過去 24 時間です。- すでに見たように、 
cursor 
特定のissueIdのissuesEventsを見つけてみましょう。
{  actor {    account(id: YOUR_ACCOUNT_ID) {      aiIssues {        issuesEvents(filter: { ids: "fe0d512f-36c7-4b7a-8a80-4c47c040807a" }) {          issues {            issueId            priority            state            title            eventType            entityGuids          }        }      }    }  }}Results
{  "data": {    "actor": {      "account": {        "aiIssues": {          "issuesEvents": {            "issues": [              {                "entityGuids": [                  "MXxTWU5USHxNT05JVE9SfGUyMzA0MjczLTQzNjUtNDRlZS1iODcxLTM5MGRhNDc1ODUxNA"                ],                "eventType": "ATTRIBUTES_UPDATED",                "issueId": "fe0d512f-36c7-4b7a-8a80-4c47c040807a",                "priority": "CRITICAL",                "state": "ACTIVATED",                "title": [                  "Test for alert emails query result is > 1.0 for 1 minutes on 'Matan email condition'"                ]              },              {                "entityGuids": [                  "MXxTWU5USHxNT05JVE9SfGUyMzA0MjczLTQzNjUtNDRlZS1iODcxLTM5MGRhNDc1ODUxNA"                ],                "eventType": "STATE_CHANGE",                "issueId": "fe0d512f-36c7-4b7a-8a80-4c47c040807a",                "priority": "CRITICAL",                "state": "ACTIVATED",                "title": [                  "Test for alert emails query result is > 1.0 for 1 minutes on 'Matan email condition'"                ]              },              {                "entityGuids": [                  "MXxTWU5USHxNT05JVE9SfGUyMzA0MjczLTQzNjUtNDRlZS1iODcxLTM5MGRhNDc1ODUxNA"                ],                "eventType": "ATTRIBUTES_UPDATED",                "issueId": "fe0d512f-36c7-4b7a-8a80-4c47c040807a",                "priority": "CRITICAL",                "state": "CREATED",                "title": [                  "Test for alert emails query result is > 1.0 for 1 minutes on 'Matan email condition'"                ]              },              {                "entityGuids": [                  "MXxTWU5USHxNT05JVE9SfGUyMzA0MjczLTQzNjUtNDRlZS1iODcxLTM5MGRhNDc1ODUxNA"                ],                "eventType": "ATTRIBUTES_UPDATED",                "issueId": "fe0d512f-36c7-4b7a-8a80-4c47c040807a",                "priority": "CRITICAL",                "state": "CREATED",                "title": [                  "Test for alert emails query result is > 1.0 for 1 minutes on 'Matan email condition'"                ]              },...インシデントの一覧表示とフィルター処理
incidentsクエリを使用すると、アカウントごとにすべてのインシデントをページ分割できます。また、インシデントごとにいくつかのフィルタリング機能も使用できます。
次の種類のインシデントがサポートされています。
- NewRelicインシデント
 - 異常インシデント
 - レストインシデント
 
フィルタリング データを指定しない場合、過去 24 時間のインシデント データが取得されます。
以下の例では、 NewRelicIncident件のインシデントを取得しています:
リクエスト
{  actor {    account(id: YOUR_ACCOUNT_ID) {      aiIssues {        incidents {          incidents {            priority            state            title            description            incidentId            updatedAt            ... on AiIssuesNewRelicIncident {              policyIds              conditionFamilyId              accountIds            }          }        }      }    }  }}結果
{  "data": {    "actor": {      "account": {        "aiIssues": {          "incidents": {            "incidents": [              {                "accountIds": "1",                "conditionFamilyId": "685305",                "description": [                  "Policy: 'Roi nov Test'. Condition: 'RB PV '"                ],                "incidentId": "a86493e4-2d25-4023-a9e5-975bfaae19a8",                "policyIds": "195617",                "priority": "HIGH",                "state": "CREATED",                "title": "[\"PageView query result is > 1.3 for 2 minutes on 'RB PV '\"]",                "updatedAt": 1651058532782              },              {                "accountIds": "1",                "conditionFamilyId": "1284850",                "description": [                  "Policy: 'Itzik first policy'. Condition: 'error logs in nrb'"                ],                "incidentId": "5de80214-6444-4e0c-aaee-fb1c42fb2f23",                "policyIds": "707052",                "priority": "CRITICAL",                "state": "CREATED",                "title": "[\"notification-request-builder query result is < 10.0 for 1 minutes on 'error logs in nrb'\"]",                "updatedAt": 1651058523473              },              {                "description": [                  "Anomaly: Error rate"                ],                "incidentId": "df4ba4f3-9463-4389-873f-b13efb67dca5",                "priority": "MEDIUM",                "state": "CREATED",                "title": "[\"Anomaly: Error rate\"]",                "updatedAt": 1651058478828              },              {                "accountIds": "1",                "conditionFamilyId": "685305",                "description": [                  "Policy: 'Roi nov Test'. Condition: 'RB PV '"                ],                "incidentId": "0063f153-9152-476d-b435-54cc38ce0245",                "policyIds": "195617",                "priority": "CRITICAL",                "state": "CREATED",                "title": "[\"PageView query result is > 1.3 on 'RB PV '\"]",                "updatedAt": 1651058472738              },              {                "description": [                  "Anomaly: It was different from normal"                ],                "incidentId": "2cb820d1-a070-4c27-860b-fb862ecd42a7",                "priority": "MEDIUM",                "state": "CREATED",                "title": "[\"Anomaly: It was different from normal\"]",                "updatedAt": 1651058449078              },              {                "accountIds": "1",                "conditionFamilyId": "751197",                "description": [                  "Policy: 'slide_Test'. Condition: 'SumOf'"                ],                "incidentId": "07104b47-0263-4529-b27d-6aff95eecd87",                "policyIds": "199127",                "priority": "CRITICAL",                "state": "CREATED",                "title": "[\"TransactionError query result is > 3.0 on 'SumOf'\"]",                "updatedAt": 1651058442361              },カーソルのページネーション
ページネーションを通じて返されるインシデントの最大数は NRQL LIMIT MAXによって設定されており、この制限を超える場合はフィルタリングが必要になることに注意してください。
インシデントのフィルタリング
エンティティ GUID、エンティティ タイプ、問題の優先度、問題の状態、またはそれらの任意の組み合わせでインシデントをフィルタリングします。
"Filter incidents"input FilterIncidents {  "entityGuids"  entityGuids: [EntityGuid!]  "entityTypes"  entityTypes: [String!]  "ids"  ids: [ID!]  "priority"  priority: [String!]  "states"  states: [IncidentState!]}timeWindowEpochMilliseconds形式の開始時間と終了時間。指定しない場合、デフォルト値は過去 24 時間です。- そして、すでに見たように
cursorです。 - 優先度が
CRITICALで状態がCREATEDのインシデントを見つけてみましょう。 
{  actor {    account(id: YOUR_ACCOUNT_ID) {      aiIssues {        incidents(filter: { priority: "CRITICAL", states: CREATED }) {          incidents {            priority            state            title            description            incidentId            updatedAt            ... on AiIssuesNewRelicIncident {              policyIds              conditionFamilyId              accountIds            }          }        }      }    }  }}結果
{  "data": {    "actor": {      "account": {        "aiIssues": {          "incidents": {            "incidents": [              {                "accountIds": "1",                "conditionFamilyId": "195908",                "description": [                  "Policy: 'AirMonitor ML Dashboard Staging'. Condition: 'Latency in Production'"                ],                "incidentId": "44630d21-9d32-4107-a308-3ed1c4f72bce",                "policyIds": "40053",                "priority": "CRITICAL",                "state": "CREATED",                "title": "[\"Metric query result is > 0.69 for 5 minutes on 'Latency in Production'\"]",                "updatedAt": 1651059983674              },              {                "accountIds": "1",                "conditionFamilyId": "195908",                "description": [                  "Policy: 'AirMonitor ML Dashboard Staging'. Condition: 'Latency in Production'"                ],                "incidentId": "3e2b2b2a-e45b-46d6-b45d-637b74b5efda",                "policyIds": "40053",                "priority": "CRITICAL",                "state": "CREATED",                "title": "[\"Metric query result is > 0.69 for 5 minutes on 'Latency in Production'\"]",                "updatedAt": 1651059983607              },              {                "accountIds": "1",                "conditionFamilyId": "195907",                "description": [                  "Policy: 'AirMonitor ML Dashboard Staging'. Condition: 'Latency in Staging'"                ],                "incidentId": "6e934358-d16b-494d-abb2-6300c4d96f11",                "policyIds": "40053",                "priority": "CRITICAL",                "state": "CREATED",                "title": "[\"Metric query result is > 0.69 for 5 minutes on 'Latency in Staging'\"]",                "updatedAt": 1651059983223              },              {                "accountIds": "1",                "conditionFamilyId": "195907",                "description": [                  "Policy: 'AirMonitor ML Dashboard Staging'. Condition: 'Latency in Staging'"                ],                "incidentId": "97373770-caad-46cd-a69d-a358de3be090",                "policyIds": "40053",                "priority": "CRITICAL",                "state": "CREATED",                "title": "[\"Metric query result is > 0.69 for 5 minutes on 'Latency in Staging'\"]",                "updatedAt": 1651059983059              },API を使用すると、インシデント ID でクエリを実行できます。
リクエスト
{  actor {    account(id: YOUR_ACCOUNT_ID) {      aiIssues {        incidents(filter: { ids: "97373770-caad-46cd-a69d-a358de3be090" }) {          incidents {            priority            state            title            description            incidentId            updatedAt            ... on AiIssuesNewRelicIncident {              policyIds              conditionFamilyId              accountIds            }          }        }      }    }  }}結果
{  "data": {    "actor": {      "account": {        "aiIssues": {          "incidents": {            "incidents": [              {                "accountIds": "1",                "conditionFamilyId": "195907",                "description": [                  "Policy: 'AirMonitor ML Dashboard Staging'. Condition: 'Latency in Staging'"                ],                "incidentId": "97373770-caad-46cd-a69d-a358de3be090",                "policyIds": "40053",                "priority": "CRITICAL",                "state": "CREATED",                "title": "[\"Metric query result is > 0.69 for 5 minutes on 'Latency in Staging'\"]",                "updatedAt": 1651059983059              }            ]          }        }      }    }  },インシデント イベントの一覧表示とフィルター処理
incidentsEventsクエリを使用すると、アカウントごとにすべてのインシデント イベントをページ分割できます。また、インシデント イベントのフィルタリング機能も使用できます。
フィルタリング データを指定しない場合、過去 24 時間のインシデント イベント データが取得されます。
リクエスト
{  actor {    account(id: YOUR_ACCOUNT_ID) {      aiIssues {        incidentsEvents {          incidents {            priority            incidentId            state            title            updatedAt            description          }        }      }    }  }}結果
{  "data": {    "actor": {      "account": {        "aiIssues": {          "incidentsEvents": {            "incidents": [              {                "description": [                  "Policy: 'e2e: hrr9ISoLd'. Condition: 'e2e: VceqCmtcT'"                ],                "incidentId": "693b7dcb-5a6b-4923-acaa-9d4e7e568ae5",                "priority": "CRITICAL",                "state": "CLOSED",                "title": "[\"Provider . Burst Balance . Average < 1 at least once in 2 minutes on 'vol-03e3199dd4b4ffac4'\"]",                "updatedAt": 1651060591602              },              {                "description": [                  "Policy: 'e2e: hrr9ISoLd'. Condition: 'e2e: VceqCmtcT'"                ],                "incidentId": "fb0dcb8b-052f-4056-8579-ff7cae8fa879",                "priority": "CRITICAL",                "state": "CLOSED",                "title": "[\"Provider . Burst Balance . Average < 1 at least once in 2 minutes on 'vol-00163b96c3ccd2199'\"]",                "updatedAt": 1651060587005              },              {                "description": [                  "Policy: 'AirMonitor ML Dashboard Staging'. Condition: 'Latency in Staging'"                ],                "incidentId": "42bcd3e2-bc2d-4a3d-9e85-ebd8597e6eba",                "priority": "CRITICAL",                "state": "CLOSED",                "title": "[\"Metric query result is > 0.69 for 5 minutes on 'Latency in Staging'\"]",                "updatedAt": 1651060560312              },カーソルのページネーション
データをページ分割するには、最初のクエリにnextCursorフィールドを含める必要があります。
インシデント イベントのフィルタリング
エンティティ GUID、エンティティ タイプ、インシデントの優先度、インシデントの状態、またはこれらの任意の組み合わせでインシデント イベントをフィルター処理します。
"Filter incidents events"input FilterIncidentsEvents {  "entityGuids"  entityGuids: [EntityGuid!]  "entityTypes"  entityTypes: [String!]  "ids"  ids: [ID!]}timeWindowEpochMilliseconds形式の開始時間と終了時間。指定しない場合、デフォルト値は過去 24 時間です。- そして、すでに見たように
cursorです。 
インシデント イベントをクエリして、「incidentId」を取得できるようにします。
{  actor {    account(id: YOUR_ACCOUNT_ID) {      aiIssues {        incidentsEvents(          filter: { ids: "cd512082-6ebe-46ac-a6dc-d387dc86dc80" }        ) {          incidents {            priority            incidentId            state            title            updatedAt            description            createdAt            timestamp            ... on AiIssuesNewRelicIncident {              accountIds              policyIds            }          }        }      }    }  }}結果
{  "data": {    "actor": {      "account": {        "aiIssues": {          "incidentsEvents": {            "incidents": [              {                "accountIds": "1",                "createdAt": "1651060523109",                "description": [                  "Policy: 'KPT: Low-urgency'. Condition: 'Kafka broker offline'"                ],                "incidentId": "cd512082-6ebe-46ac-a6dc-d387dc86dc80",                "policyIds": "80113",                "priority": "CRITICAL",                "state": "CREATED",                "timestamp": 1651060523110,                "title": "[\"Signal lost for 35 minutes on 'Kafka broker offline'\"]",                "updatedAt": 1651060523110              },              {                "accountIds": "1",                "createdAt": "1651060523109",                "description": [                  "Policy: 'KPT: Low-urgency'. Condition: 'Kafka broker offline'"                ],                "incidentId": "cd512082-6ebe-46ac-a6dc-d387dc86dc80",                "policyIds": "80113",                "priority": "CRITICAL",                "state": "CREATED",                "timestamp": 1651060523110,                "title": "[\"Signal lost for 35 minutes on 'Kafka broker offline'\"]",                "updatedAt": 1651060523110              },              {                "accountIds": "1",                "createdAt": "1651060523109",                "description": [                  "Policy: 'KPT: Low-urgency'. Condition: 'Kafka broker offline'"                ],問題の機能を構成する
Issues サービスには、いくつかの構成パラメーターがあります。
環境の現在の構成パラメーターを取得するには、 configByEnvironmentクエリを実行できます。
リクエスト
{  actor {    account(id: YOUR_ACCOUNT_ID) {      aiIssues {        configByEnvironment {          config {            flappingInterval            inactivePeriod            incidentTimeout            issueTtl            maxIssueSize          }        }      }    }  }}結果
{  "data": {    "actor": {      "account": {        "aiIssues": {          "configByEnvironment": {            "config": {              "flappingInterval": 0,              "gracePeriod": [                {                  "period": 60,                  "priority": "CRITICAL"                },                {                  "period": 300,                  "priority": "HIGH"                },                {                  "period": 600,                  "priority": "MEDIUM"                },                {                  "period": 900,                  "priority": "LOW"                }              ],              "inactivePeriod": 14400,              "incidentTimeout": 90000,              "issueTtl": 259200,              "maxIssueSize": 5000            }          }        }      }    }  }ここで、各環境構成には次のパラメーターがあります。
"Environment configuration object"type EnvironmentConfiguration {  "Flapping interval in seconds"  flappingInterval: Seconds  "Grace periods per priority"  gracePeriod: [GracePeriodConfig!]  "Inactive period in seconds"  inactivePeriod: Seconds  "Incident timeout in seconds"  incidentTimeout: Seconds  "Issue TTL in seconds"  issueTtl: Seconds  "Max incidents in the issue"  maxIssueSize: Int}対応するmutationsを使用して、 issueTtlおよびgracePeriod環境構成パラメーターを変更することもできます。
aiIssuesUpdateIssueTtlaiIssuesUpdateGracePeriod
リクエスト
mutation {  aiIssuesUpdateIssueTtl(accountId: YOUR_ACCOUNT_ID, issueTtl: 259200) {    error    config {      flappingInterval      gracePeriod {        period        priority      }      inactivePeriod      incidentTimeout      issueTtl      maxIssueSize    }  }}結果
{  "data": {    "aiIssuesUpdateIssueTtl": {      "config": {        "flappingInterval": 0,        "gracePeriod": [          {            "period": 60,            "priority": "CRITICAL"          },          {            "period": 300,            "priority": "HIGH"          },          {            "period": 600,            "priority": "MEDIUM"          },          {            "period": 900,            "priority": "LOW"          }        ],        "inactivePeriod": 14400,        "incidentTimeout": 90000,        "issueTtl": 259200,        "maxIssueSize": 5000      },      "error": null    }  },問題を承認または未承認にする
mutationsを使用すると、特定の問題をissueIdで確認または確認解除して解決できます。
- aiIssuesAckIssue
 - aiIssuesResolveIssue
 - aiIssuesUnackIssue
 
リクエスト
mutation {  aiIssuesResolveIssue(    accountId: 10581561    issueId: "f0846f5e-fc9d-4dc0-afdd-07cce7cc6fc4"  ) {    error    result {      action      accountId      issueId      routingKey    }  }}結果
{  "data": {    "aiIssuesResolveIssue": {      "error": null,      "result": {        "accountId": 10581561,        "action": "RESOLVE",        "issueId": "f0846f5e-fc9d-4dc0-afdd-07cce7cc6fc4",        "routingKey": "93538a443af520d10e7999fdb183ebf21e4cb6bd"      }    }コマンドラインからの実行
コマンドラインからクエリを実行するには:
1 API キーを取得し、 API キー UIで取得または作成します。
2それをシェルにエクスポートします export API_KEY=my_api_key
3 次の例を実行します。
重要
リクエストには実験的なオプトイン ヘッダーを含める必要があります。そうしないと、次のようなアクセス エラーが発生します。
{"data":{"actor":{"account":{"aiIssues":{"issues":null}}}},"errors":[{"extensions":{"errorClass":"ACCESS_DENIED","nrOnly":{}},"locations":[{"column":70,"line":1}],"message":"You must opt in to using experimental schemas by passing the 'nerd-graph-unsafe-experimental-opt-in: AiIssues' header.\n\nProviding the header indicates that you acknowlege that the field(s) you are querying are subject to breaking changes.\n","path":["actor","account","aiIssues","issues"]}]}%過去 24 時間の問題をすべて一覧表示する
GraphQL UI でのリクエストの外観
{  actor {    account(id: YOUR_ACCOUNT_ID) {      aiIssues {        issues {          issues {            issueId            priority            state            title          }        }      }    }  }}コマンドラインから同じリクエスト
{  "data": {    "aiIssuesResolveIssue": {      "error": null,      "result": {        "accountId": 10581561,        "action": "RESOLVE",        "issueId": "f0846f5e-fc9d-4dc0-afdd-07cce7cc6fc4",        "routingKey": "93538a443af520d10e7999fdb183ebf21e4cb6bd"      }    }結果
{  "data": {    "actor": {      "account": {        "aiIssues": {          "issues": {            "issues": [              {                "issueId": "eb152a9f-def7-45bd-9b3f-34ec61ef8c82",                "priority": "MEDIUM",                "state": "CREATED",                "title": [                  "Anomaly: It was different from normal"                ]              },              {                "issueId": "9ae6a86a-582f-4102-8757-ee11c1a20dfc",                "priority": "HIGH",                "state": "CREATED",                "title": [                  "Web throughput < 50 for at least 5 minutes on 'error-group-control-plane (staging)'"                ]              },              {                "issueId": "e19aa2d0-2b12-4148-aedd-848577e9c4fc",                "priority": "CRITICAL",                "state": "CREATED",                "title": [                  "clm-10 query result is > 1.0 for 15 minutes on 'NO_CONSUMER'"                ]              },              {                "issueId": "9184ab3c-4e45-4bc9-b2a5-f78c23a13197",                "priority": "MEDIUM",                "state": "CREATED",                "title": [                  "Anomaly: It was different from normal"                ]              },              {                "issueId": "e2d05a25-2a7e-4b3c-b5bf-8a236f2a0360",                "priority": "MEDIUM",                "state": "CREATED",                "title": [                  "Anomaly: It was different from normal"                ]              },              {                "issueId": "b478bd0e-baa1-42ed-8911-d32249d45010",                "priority": "CRITICAL",                "state": "ACTIVATED",                "title": [                  "PageViewTiming query deviated from the baseline at least once in 5 minutes on 'Onyx_check_Mark test'"                ]              },              {                "issueId": "f672153a-262b-4405-85a7-874709ed21ff",                "priority": "MEDIUM",                "state": "CREATED",                "title": [                  "Anomaly: It was different from normal"                ]              },              ...