• Log inStart now

NrqlQuery

Usage

import { NrqlQuery } from 'nr1'

Examples

Props

accountIddeprecatednumber

Due November 1st, 2022

The "accountId" prop is deprecated, use "accountIds" prop instead.

Identifier of the account to execute the NRQL query against.

accountIdsrequirednumber[]

Identifiers of accounts to execute the NRQL query against.

childrenfunction

Render prop function as a child.

function (
queryResult: QueryResult

Results of the query.

) => React.ReactNode
formatTypeenum
DEFAULT
NrqlQuery.FORMAT_TYPE.CHART

Format of the response.

<One of
NrqlQuery.FORMAT_TYPE.CHART,
NrqlQuery.FORMAT_TYPE.RAW,
>
offsetnumber

Offset to apply to the computed begin_time and end_time, in epoch milliseconds. This offset is only applied when the query is open ended, that is:

  1. end_time is not specified, and
  2. duration is specified.

If these conditions are met and an offset value is present, the effective end_time will be set to offset milliseconds ending now, while the effective begin_time will be set to (offset + duration) milliseconds before that end_time.

pollIntervalnumber|enum

Interval in millisecond to poll for new data or automatically set based on response data's metadata.

skipboolean
DEFAULT
false

When set to true, the query will be skipped entirely from rendering.

timeRangeshape

Time range to scope NRQL query time range. When only duration is provided it uses duration to query from NOW back until DURATION (aka Open ended query). When begin_time and end_time are provided it uses them to query SINCE begin_time UNTIL end_time (aka Closed query).

shape

begin_timenumber
durationnumber
end_timenumber

Methods

NrqlQuery.query

function (
props: Object

Object containing the query options. Any NrqlQuery prop is a valid option except children and pollInterval.

) => PromiseQueryResult

Type definitions

PromiseQueryResult

{
error: ApolloClient.ApolloError,

Runtime error with graphQLErrors and networkError properties.

data: Object,

Object containing the result of your query.

fetchMore: function|null,

If not null, fetchMore allows you to load more results for your query. New data is merged with previous data.

refetch: function,

Refetch the query.

}

QueryResult

{
loading: boolean,

Indicates that the request is in flight.

error: ApolloClient.ApolloError,

Runtime error with graphQLErrors and networkError properties.

data: Object,

Object containing the result of your query.

fetchMore: function|null,

If not null, fetchMore allows you to load more results for your query. New data is merged with previous data.

refetch: function,

Refetch the query.

}
Copyright © 2024 New Relic Inc.

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