• /
  • Log in
  • Free account

NrqlQuery

Fetch data to CDS via a NRQL query.

The component can return data in a format compatible with the Chart component.

Usage

import { NrqlQuery } from 'nr1'

Examples

Transform data

ReferenceError: NrqlQuery is not defined

Polling data

1
<NrqlQuery
2
pollInterval={2000}
3
accountId={1}
4
query="SELECT count(*) FROM `Synthetics` SINCE 1 DAY AGO TIMESERIES AUTO FACET jobType"
5
>
6
{({ data }) => {
7
return <LineChart data={data} />;
8
}}
9
</NrqlQuery>;

Props

accountIdrequirednumber

Account ID to execute the NRQL query against.

childrenfunction

Render prop function as a child.

function (
queryResult: {Object //

Results of the query.

) => undefined
formatTypeenum
DEFAULT
NrqlQuery.FORMAT_TYPE.CHART

Format of the response.

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

Interval in millisecond to poll for new data.

queryrequiredstring

Methods

NrqlQuery.render

function () => undefined

NrqlQuery.query

function () => undefined
Create issueEdit page
Copyright © 2021 New Relic Inc.