newrelic/cli

Verified Publisher

By New Relic

Updated 10 days ago

The New Relic Command Line Interface

Image
8

5M+

Overview

The New Relic CLI is a project to consolidate some of the tools that New Relic offers for managing resources. Current scope is limited while the framework is being developed, but the tool as-is does perform a subset of tasks.

  • Entity Search: Search for entities across all your New Relic accounts
  • Entity Tagging: Manage tags across all of your entities
  • Deployment Markers: Easily record an APM Application deployment within New Relic.
Other Resources

There are a handful of other useful tools that this does not replace. Here are some useful links to other tools that you might be interested in using at this time.

  • NR1 CLI: Command line interface for managing development workflows for custom Nerdpacks on New Relic One.
  • New Relic Lambda CLI: A CLI to install the New Relic AWS Lambda integration and layers.
  • New Relic Diagnostics: A utility that automatically detects common problems with New Relic agents.

Usage

Docker

There is a docker image that can be utilized for running commands as well.

Note: You must pass in NEW_RELIC_API_KEY, which is your Personal API Key

APM Application Example

# Pull the latest container
$ docker pull newrelic/cli

# Run the container interactively, remove it once the command exists
# Also must pass $NEW_RELIC_API_KEY to the container
$ docker run -it --rm \
    -e NEW_RELIC_API_KEY \
    newrelic/cli \
    entity search --name WebPortal

[
  {
    "accountId": 2508259,
    "alertSeverity": "NOT_CONFIGURED",
    "applicationId": 204261368,
    "domain": "APM",
    "entityType": "APM_APPLICATION_ENTITY",
    "guid": "MjUwODI1OXxBUE18QVBQTElDQVRJT058MjA0MjYxMzY4",
    "language": "java",
    "name": "WebPortal",
    "permalink": "https://one.newrelic.com/redirect/entity/MjUwODI1OXxBUE18QVBQTElDQVRJT058MjA0MjYxMzY4",
    "reporting": true,
    "runningAgentVersions": {
      "maxVersion": "",
      "minVersion": "5.3.0"
    },
    "settings": {
      "apdexTarget": 0.5,
      "serverSideConfig": false
    },
    "type": "APPLICATION"
  }
]

Docker Pull Command

docker pull newrelic/cli