How to View Custom Metrics in NRQL View?

In my Java application, I recently wrote a main method that does the following:

com.newrelic.api.agent.NewRelic.incrementCounter("foobar")

and then runs forever, i.e. never terminates.

My newrelic directory structure is:

$ls newrelic
new_relic.yml			newrelic-agent-7.7.0.jar
$cat newrelic/new_relic.yml 
common: &default_settings

  license_key: 'ec.....'

  agent_enabled: true
  app_name: Testing

But, I see no data when searching on:

SELECT * from Metric where appName = 'Testing'

in New Relic via the NRQL view.

How can I view this counter’s value?

Hi @kevin.m.meredith

Congrats on your first post in the community, I hope you are well.

it sounds like you wish to view your metrics using NRQL, which is not possible as the 2 don’t interact in this way.

NRQL may be used only with events, not metrics.

What I would bring to your attention, in New Relic a metric is numeric data that is aggregated at one-minute intervals. NRQL can not be used on this data.

As a potential work around please have a look at our docs on JMX integration for New Relic Infrastructure .

Please see this post for guidance on the same issue.

I hope this provided clarity and assistance, should you have any additional questions please do reach out!

You can try the Metric Explorer in the APM for that application.
The link is under More views.