You can use New Relic's REST API and your API key to obtain information about a single component for your plugin, including:
- The summary metric values in raw and formatted form as set by the plugin publisher
- Threshold data indicating where Caution and Critical alerts will be triggered
- The
COMPONENT_ID
andCOMPONENT_NAME
for the plugin - Summary information, including
SUMMARY_METRIC_ID
andSUMMARY_METRIC_NAME
- The associated summary metric information, including
METRIC_NAME
andMETRIC_VALUE
You can use the API Explorer to list components.
Tip
When using these examples, be sure to replace each placeholder (for example, ${PLUGIN_ID}
) with its specific ID.
List by component name
To obtain a list of the summary data values for a single component by name, use:
curl -X GET 'https://api.newrelic.com/v2/components.json' \ -H "X-Api-Key:${APIKEY}" -i \ -d "filter[name]=${COMPONENT_NAME}"
List by component ID
To obtain a list of the summary data for a single component by its component ID, use one of the following commands.
curl -X GET 'https://api.newrelic.com/v2/components.json' \ -H "X-Api-Key:${APIKEY}" -i \ -d "filter[id]=${COMPONENT_ID}"
OR:
curl -X GET "https://api.newrelic.com/v2/components/${COMPONENT_ID}.json" \ -H "X-Api-Key:${APIKEY}" -i
View the component's output
The output for each component ID will be similar to the following example (annotated and formatted for JSON). Due to the potential length of the output, you may want to paginate it.
{ "components": [ { "id": 3947935, <---<<< COMPONENT_ID "name": "F5-01-prod", <---<<< COMPONENT_NAME "summary_metrics": [ { "id": 116635, <---<<< SUMMARY_METRIC_ID "name": "CPU", <---<<< SUMMARY_METRIC_NAME "metric": "Component/CPU/Total/Global[%]", <---<<< METRIC_NAME "value_function": "average_value", <---<<< METRIC_VALUE "thresholds": { "caution": 75, <---<<< SUMMARY_METRIC_CAUTION_THRESHOLD "critical": 85 <---<<< SUMMARY_METRIC_CRITICAL_THRESHOLD }, "values": { "raw": 78.79225, <---<<< SUMMARY_METRIC_VALUE "formatted": "78.8 %" <---<<< Formatted SUMMARY_METRIC_VALUE } }, { "id": 116636, "name": "Throughput", "metric": "Component/Throughput/Total[bits/sec]", "value_functions": ... . . . } . . . ] } },}
For more help
If you need more help, check out these support and learning resources:
- Browse the Explorers Hub to get help from the community and join in discussions.
- Find answers on our sites and learn how to use our support portal.
- Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS.
- Review New Relic's data security and licenses documentation.