Listing all custom metrics

Is there a way to list all custom metrics defined in an account using the REST API?
i.e. something like:

▶ curl -X GET 'https://metric-api.newrelic.com/metric/v1/custom_metrics.json' \
     -H 'X-Api-Key:MY-API-KEY' -i \
     -H 'Content-Type: application/json'

Hi, @pantelis: You may use the REST API to list metric names for your application. You may also get metric names via NRQL:

SELECT uniques(metricName) 
FROM Metric 
WHERE appName = 'Your Application'

I don’t think either method offers a way to identify custom metrics.

So if I have defined a Custom Metric in the form of Custom/My/MetricName will this appear in the above NRQL?

I am asking because I do have some custom metrics as in the above form but they do not appear in the following query

SELECT uniques(metricName) 
FROM Metric 

I believe only metrics that you create using the Metric API will be returned by the NRQL query. Other metrics should be returned by the REST API.

3 Likes