Use integration data in New Relic Insights

Most data generated by integrations is available in New Relic Insights, where you can query your data using NRQL and build custom dashboards. The following tips and sample queries were created for New Relic-built integrations, but most will also apply to integrations built with the Integrations SDK.

For a general look at how to find and use integration data, see Understand integration data.

Get started with integration data in Insights

Here are some tips for finding and exploring your integration data in Insights:

  • From the Infrastructure Integrations UI page, select an integration's dashboard. There, you can see how the NRQL queries are formed, which will help you make your own Insights queries. For examples of integration NRQL queries, see Examples.
  • Use the Insights data explorer to explore and understand the available data.
  • Read the documentation for a specific integration to learn about the reported data.
  • When you create a useful query you'd like to add to your Insights dashboard, select Add to dashboard. For more information, see Building dashboards.

Example NRQL queries

Here are some examples of NRQL queries that use integration data:

AWS EBS query example

Here's a NRQL query for the AWS EBS service, showing the total write time metric over the past day, faceted by displayName:

select average(`provider.volumeTotalWriteTime.Sum`) from BlockDeviceSample WHERE provider = 'EbsVolume' AND providerAccountId = '72' facet displayName TIMESERIES SINCE 1 day ago
Azure Service Bus query example

Here's an Insights NRQL query for the number of messages in an Azure Service Bus topic queue, faceted by name:

SELECT average(activeMessages) from AzureServiceBusTopicSample TIMESERIES 5 minutes since 6 hours ago FACET displayName
Azure Functions query example

Here's an Insights NRQL query for Azure Functions, showing the count of executed functions over the past six hours:

SELECT sum(`functionExecutionCount.Total`) FROM AzureFunctionsAppSample WHERE providerAccountId = '125' SINCE 6 hour ago TIMESERIES auto FACET displayName
Azure VMs query example

Here's an Insights NRQL query for Azure VMs that compares the count of VM events over the past thirty minutes with the same time a week ago:

SELECT count(*) FROM AzureVirtualMachineSample SINCE 30 MINUTES AGO COMPARE WITH 1 WEEK AGO WHERE provider = 'AzureVirtualMachine' TIMESERIES
NGINX query example

Here's an example of a query that you might run on your NGINX integration data and place in an Insights dashboard. This query creates a chart showing the average value of NGINX requests per second over time:

SELECT average(`requestsPerSecond`) as 'Requests' FROM NginxSample TIMESERIES until 1 minutes ago

For more on how to create queries, see NRQL syntax.

MySQL query example

Here's an example of a query that you might run on your MySQL integration data. This query generates a chart showing active MySQL connections over time:

SELECT average(`connectionsActive`) as 'Active Connections' FROM MysqlSample TIMESERIES until 1 minutes ago

For more on how to create queries, see NRQL syntax.

Inventory change query example

Here's an example of a query that groups inventory change events from the last day by the type of change:

SELECT count(*) from InfrastructureEvent where format='inventoryChange' facet changeType since 1 day ago

Tips for using different data types

Integrations can generate metric, event, and inventory data, all of which are available for querying in New Relic Insights. Here are some tips for using the different types of integration data in Insights:

Metric data tips

Tips for finding and using integration metric data in Insights:

  • All integration data available in Insights is stored attached to events, not to be confused with integration events (important activity in your host/service). This means that all integration data, including metric data, can be found via the Insights event data explorer, and not the metric data explorer. For more about these two basic New Relic data types, see New Relic data collection.
  • In Insights, metric values are treated as attributes: key-value pairs attached to an Insights event. For example, the MySQL integration has an 'active connections' metric; this would be found in Insights by querying the connectionsActive attribute of the MysqlSample event.

For general information about metrics, see Integration metric data.

Event data tips

Here are some tips for finding and using integration event data in Insights:

  • Most integration events are inventory change events. When inventory is changed, it generates an InfrastructureEvent with a format value of inventoryChange.
  • Integration data in Insights, including metric data, can be found via the Insights event data explorer, and not the metric data explorer. This is because data objects in Insights are referred to as events (this is a separate usage from how important activity in your system reported by integrations are referred to as events).

For general information about events, see Integration event data.

Inventory data tips

Here are some tips for finding and using integration inventory data in Insights:

For general information about inventory data, see Integration inventory data.

  • Some inventory data is added as attributes (key-value pairs) to Insights data. For example, the AWS EC2 integration collects awsRegion as inventory data; this would be found in Insights by querying the awsRegion attribute of the ComputeSample event type and provider Ec2Instance. Not all inventory data available in Infrastructure is made available in Insights; just those determined to be most important.
  • When inventory data changes, an Insights InfrastructureEvent event type is generated with a format value of inventoryChange. See the query examples for an example of querying this data.

For more on using NRQL queries, see Intro to NRQL.

For more help

Recommendations for learning more: