• EnglishEspañol日本語한국어Português
  • Log inStart now

Nerdgraph tutorial: Issue and incident query APIs

This page is a place for you and your team to learn how to query your data for issues and incidents and then configure features using our NerdGraph API.

Our two main data types are Issue Type and Incident Type.

Issue Type

You can learn more about data types of New Relic here:

Name

Type

Description

accountIds

[Int!]!

A list of account Ids. As an issue could be correlated with others from other accounts.

acknowledgedAt

EpochMilliseconds

The time the issue was acknowledged.

acknowledgedBy

String

The user that acknowledged the issue.

activatedAt

EpochMilliseconds

The time the issue was activated: createdAt + gracePeriod.

closedAt

EpochMilliseconds

The time the issue was closed.

closedBy

String

The user that manually closed the issue.

createdAt

EpochMilliseconds

The time the issue was created.

description

[String!]!

A list of incident descriptions.

entityGuids

[EntityGuid!]

A list of unique entity identifiers.

entityNames

[String!]

A list of entity names.

entityTypes

[String!]

A list of entity types.

environmentId

[Int!]!

See overview of applied intelligence to learn about environments.

eventType

String!

An issue event that could be INCIDENT_ADDED, USER_ACTION, INCIDENT_CLOSED, etc.

incidentIds

[String!]

A list of incident IDs in this issue. In some cases there may be thousands of incidents in an issue.

isCorrelated

Boolean!

True means that other issues were correlated to this one.

isIdle

Boolean!

See our documentation to learn about idle issues.

issueId

ID!

Issue identifier.

origins

[String!]!

A list of origins of incidents like incidents, anomalies, and external.

priority

Priority!

The issue priority. Can be one of: LOW, MEDIUM, HIGH, CRITICAL.

sources

[String!]!

A list of sources of the incidents like newrelic or external.

state

IssueState!

Issue state can be one of: CREATED, ACTIVATED, DEACTIVATED, CLOSED.

title

[String!]!

A list of underlying incident titles.

totalIncidents

Int!

The count of underlying incidents.

updatedAt

EpochMilliseconds!

The time the issue was last updated.

Issue lifecycle and state

Idle issues:

  • An issue can become idle if it is too big, meaning it contains 5000 incidents or more.
  • An idle issue does not accept any more incidents.
  • An idle issue will not correlate to other issues.

Incident type

Field

Type

Description

accountIds

String

An account id this incident is stored in.

closedAt

EpochMilliseconds

The time the incident was closed.

createdAt

EpochMilliseconds

The time the incident was created.

description

String

The description is generated from the policy name and the condition name or provided through API.

entityGuids

EntityGuid

An unique entity identifier.

entityNames

String

An entity name.

entityTypes

String

An entity type.

environmentId

Int!

See our documentation to learn about environments.

incidentId

ID

Incident identifier.

priority

Priority

Incident priority. Can be one of: LOW, MEDIUM, HIGH, CRITICAL.

state

IncidentState.

Incident state. Can be one of:CREATED, CLOSED.

timestamp

EpochMilliseconds

Incident event timestamp.

title

String

The description the user gave the condition if provided.

updatedAt

EpochMilliseconds

The time the incident was last updated.

anomalyId

Optional

If this incident originated from a New Relic anomaly it will have an anomaly ID.

conditionFamilyId

Optional

The condition id

policyIds

String

The Id of the policy that generated this incident.

aggregationTags

[KeyValue!]

Aggregation of tags related to this incident.

List and filter issues

The issues query allows you to paginate through all of your issues per account. It also allows some filtering functionality on the issues.

List and filter issue events

The issuesEvents query allows you to paginate through all of your issues events per account. It also allows some filtering functionality on the issues events.

List and filter Incidents

The incidents query allows you to paginate through all of your incidents per account. It also allows some filtering functionality on each incident.

The following types of incidents are supported:

  • NewRelicIncident
  • AnomalyIncident
  • RestIncident

List and filter incident events

The incidentsEvents query allows you to paginate through all of your incidents events per account. It also allows some filtering functionality on the incidents events.

Configure issues features

Issues service has some configuration parameters.

To get the current configuration parameters for your environment, you can run configByEnvironment query.

Acknowledge or unacknowledge issues

Using mutations you can acknowledge or unacknowledge and resolve the given issue by its issueId.

  • aiIssuesAckIssue
  • aiIssuesResolveIssue
  • aiIssuesUnackIssue

Running from the command line

To run queries from the command line:

1 Get your API key, fetch or create one in the API Key UI.

2 Export it to your shell with export API_KEY=my_api_key

3 Run these examples:

Important

You must include an experimental opt-in header in your requests. Otherwise, you get access errors like this:

{"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"]}]}%
Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.