Your data. Anywhere you go.

New Relic for iOS or Android

Download on the App Store    Android App on Google play

New Relic Insights App for iOS

Download on the App Store

Learn more

Close icon

NRQL both custom Metric from integration and agent attributes


I am trying to create an alert that will query all host that match my agent custom attribute (test-stephen-attribute and my custom metric set httpcheck (metrics collected, 0/1 as IsAlive and latency in ms.

I am able to query SystemState for the agent attribute. I am able to query my custom metrics from the entity/metric name of httpcheck. What I can’t seem to do is create a query where I count customMetric.latency against all agent attributes with test-stephen-attribute.

The query for my custom integration metrics

  • SELECT average(serverProcessingLatencyms) FROM httpcheck
    Returns the avg latency from all servers and graphs it.

The query for hosts with my custom attributes

  • SELECT count(*) FROM SystemSample WHERE test-stephen-attribute = ‘test-attribute-value’
    Returns a value of 1 because there is only 1 host.

What I want to do is query all host that has the ‘test-stephen-attribute’ and collect all httpcheck metrics (IsAlive(0/1), ServerProcessingLatencyms. This seems like the data is in 2 separate tables SystemSample and httpcheck. There is no JOIN in NRQL so how can I query using both data sets?


Hey @stephen.lester - Thanks for posting.

Do you have a snippet of the code you are using to send this custom data? I’m curious if this is coming in as a custom metric or custom attribute. Both are similar but slightly different so seeing how you’re sending the data will help us troubleshoot why it’s not working how you’d expect for your NRQL queries