When using New Relic's REST API Explorer (v2) to get metric timeslice data for your application, you need:
- An API key
- The app's ID
- The type of metric timeslice data available for your app, including the metric names and values
View your app's ID
To view your app's ID:
- From the New Relic REST API Explorer, select Applications > GET List.
- If you are not signed in to New Relic, provide an API key for your app.
- Optional: From Applications > List, fill in values for the
name
,ids
, orlanguage
filters. - Select Send Request.
- From the Response section, copy the app's
id
.
Continue with the procedure to view metric names.
View metric names for your app
To view the metric timeslice data available for your app:
- From the New Relic REST API Explorer, select Applications > GET Metric Names.
- From Applications > Metric Names, type or paste your application ID.
- Fill in a specific or partial metric
name
, or leave blank to view the list of available metric names and values. - Select Send Request.
- From the Response section, review the app's available
metrics
.
Continue with the procedure to get metric timeslice data.
Get metric timeslice data for your app
To get the metric values for your app, copy the values from the Metric Names results, and paste them in the Metric Timeslice Data fields:
- From the New Relic REST API Explorer, select Applications > GET Metric Data.
- From Applications > Metric Data, type or paste your application ID.
- Type or paste one or more
names
(from GET Metric Names) for your app. Start each name on a new line. - Select Send Request.
- From the Response section, review the app's available
metric_data
.
After reviewing the Response section, you can continue making adjustments, and select Send Request again. For example:
- To specify a time range for the metric timeslice data, fill the
from
andto
values. - To create an average of the data over the time range, set
summarize
totrue
. Or, to keep the data for each time period for the range you have specified, leavesummarize
blank.
View other REST API data
To use the API Explorer with other New Relic capabilities, select the corresponding API key. This may include:
- Synthetic monitoring
- Partners