You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/markdown-pages/automate-workflows/get-started-new-relic-cli.mdx
+52-32
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ tags:
23
23
24
24
<Intro>
25
25
26
-
Access the New Relic platform from the comfort of your terminal: you can use the New Relic CLI to manage entity tags, define workloads, record deployment markers, and much more. Our CLI has been designed for automating common tasks in your DevOps workflow. This guide walks you through the essentials of New Relic CLI, from install and configuration to basic usage.
26
+
Access the New Relic platform from the comfort of your terminal. You can use the New Relic CLI to manage entity tags, define workloads, record deployment markers, and much more. In short, you can use the CLI to automate common tasks in your DevOps workflow. This guide walks you through the essentials of New Relic CLI, from install and configuration to basic usage.
27
27
28
28
<Videoid="6uw3tu0d23"type="wistia"/>
29
29
</Intro>
@@ -32,45 +32,45 @@ Access the New Relic platform from the comfort of your terminal: you can use the
32
32
33
33
For this guide you just need:
34
34
35
-
1. A New Relic [user key](https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys#user-api-key): you can create this from the [API keys UI](https://one.newrelic.com/launcher/api-keys-ui.api-keys-launcher)
36
-
2. An [instrumented application](https://docs.newrelic.com/docs/agents/manage-apm-agents/installation/install-agent) in your New Relic account
35
+
- Your New Relic [personal API Key](https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys#personal-api-key), which you can create from the **Account settings** of your New Relic account
36
+
- An [instrumented application](https://docs.newrelic.com/docs/agents/manage-apm-agents/installation/install-agent) in your New Relic account
37
37
38
38
<Steps>
39
39
<Step>
40
40
41
-
## Install the New Relic CLI
41
+
Install the New Relic CLI
42
42
43
-
The New Relic CLI can be downloaded via [Homebrew](https://brew.sh/) (macOS), [Scoop](https://scoop.sh/) (Windows), and [Snapcraft](https://snapcraft.io/) (Linux). You can also download [pre-built binaries](https://github.com/newrelic/newrelic-cli/releases) for all platforms, including .deb and .rpm packages, and our Windows x64 .msi installer.
43
+
Download the New Relic CLI for your operating system, as described below. You can also download [pre-built binaries](https://github.com/newrelic/newrelic-cli/releases) for all platforms, including .deb and .rpm packages, and our Windows x64 .msi installer.
Now that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts.
86
+
After you install the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts.
87
87
88
-
To create your first CLI profile, run the [`profiles add`](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_profile_add.md) command. Note that you need to set the [region](https://docs.newrelic.com/docs/using-new-relic/welcome-new-relic/get-started/our-eu-us-region-data-centers) of your New Relic account: use `-r` to set either `us` or `eu` (this is required).
88
+
Run the [`profiles add`](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_profile_add.md) command:
You must set the [region](https://docs.newrelic.com/docs/using-new-relic/welcome-new-relic/get-started/our-eu-us-region-data-centers) of your New Relic account. Use `-r` to set either `us` or `eu`.
100
+
101
+
</Callout>
102
+
97
103
</Step><Step>
98
104
99
-
## Get your application details
105
+
Get your application details.
100
106
101
-
In this example, you are going to add tags to the application you've instrumented with New Relic. [Tags](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/core-concepts/tagging-use-tags-organize-group-what-you-monitor) are key-value pairs that can help you organize and filter your entities. An [entity](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/core-concepts/what-entity-new-relic) (for example, an application) can have a maximum of 100 key-value pairs tied to it.
107
+
Now, add tags to the application you've instrumented with New Relic. [Tags](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/core-concepts/tagging-use-tags-organize-group-what-you-monitor) are key-value pairs that can help you organize and filter your entities. An [entity](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/core-concepts/what-entity-new-relic) (for example, an application) can have a maximum of 100 key-value pairs tied to it.
102
108
103
109
Before searching for your application using the New Relic CLI, write down or copy your [Account ID](https://docs.newrelic.com/docs/accounts/install-new-relic/account-setup/account-id) and the [name of your application in New Relic](https://docs.newrelic.com/docs/agents/manage-apm-agents/app-naming/name-your-application) - you need both to find applications in the New Relic platform.
104
110
105
111
</Step><Step>
106
112
107
-
The New Relic CLI can retrieve your application details as a JSON object.
113
+
Retrieve your application details as a JSON object.
108
114
109
-
To search for your APM application use the [`apm application search`](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_apm_application_search.md) command. If you get an error, check that the account ID and application name you provided are correct.
115
+
To search for your APM application, use the [`apm application search`](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_apm_application_search.md) command:
If you get an error, check that your account ID and application name are correct.
124
+
125
+
</Callout>
126
+
115
127
</Step><Step>
116
128
117
-
If the account ID is valid, and the application name exists in your account, `apm application search` yields data similar to this example.
129
+
Find the `guid` value.
118
130
119
-
When you've successfully searched for your application, look for the `guid` value. It's a unique identifier for your application. You should copy it or write it down.
131
+
If the account ID is valid, and the application name exists in your account, `apm application search` yields data similar to this example:
120
132
121
133
```json lineNumbers=false
122
134
[
@@ -134,27 +146,31 @@ When you've successfully searched for your application, look for the `guid` valu
134
146
]
135
147
```
136
148
149
+
When you've successfully searched for your application, look for the `guid` value. It's a unique identifier for your application. You should copy it or write it down.
150
+
137
151
</Step><Step>
138
152
139
-
## Add a simple tag to your application
153
+
Add a simple tag to your application.
140
154
141
155
Now that you have the GUID, you can point the New Relic CLI directly at your application. Adding a tag is the simplest way to try out the CLI capabilities (don't worry, tags can be deleted by using [`entity tags delete`](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_entity_tags_delete.md)).
142
156
143
-
Let's suppose that you want to add an environment tag to your application. Go ahead and add the `dev:testing` tag (or any other key-value pair) to your application using the [`entities tags create`](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_entity_tags_create.md) command.
157
+
Here, you add an environment tag to your application. Add the `dev:testing` tag (or any other key-value pair) to your application using the [`entities tags create`](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_entity_tags_create.md) command:
What if you want to add multiple tags? Tag sets come to the rescue! While tags are key-value pairs separated by colons, tag sets are comma separated lists of tags. For example:
165
+
Add tag sets.
166
+
167
+
What if you want to add multiple tags? Tag sets to the rescue! While tags are key-value pairs separated by colons, tag sets are comma separated lists of tags. For example:
152
168
153
169
```txt copyable=false
154
170
tag1:value1,tag2:value2
155
171
```
156
172
157
-
To add multiple tags at once to your application, modify and run the following snippet.
173
+
To add multiple tags to your application at once, modify and run this snippet:
@@ -168,15 +184,17 @@ Adding tags is an asynchronous operation: this means it could take a while for t
168
184
169
185
</Step><Step>
170
186
171
-
You've created and added some tags to your application, but how do you know they're there? You need to retrieve your application's tags.
187
+
Retrieve your application's tags.
188
+
189
+
You've created and added some tags to your application, but to test that they're working, you need to retrieve them.
172
190
173
-
To retrieve your application's tags, use the [`entity tags get`](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_entity_tags_get.md) command.
191
+
Run the [`entity tags get`](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_entity_tags_get.md) command:
174
192
175
193
```sh
176
194
newrelic entity tags get --guid YOUR_APP_GUID
177
195
```
178
196
179
-
All tags associated with your application are retrieved as a JSON array.
197
+
All tags associated with your application are retrieved as a JSON array:
180
198
181
199
```json lineNumbers=false
182
200
[
@@ -198,21 +216,23 @@ All tags associated with your application are retrieved as a JSON array.
198
216
199
217
</Step><Step>
200
218
201
-
## Bonus step: Create a deployment marker
219
+
Bonus step: create a deployment marker.
202
220
203
221
Deployments of applications often go wrong. [Deployment markers](https://docs.newrelic.com/docs/apm/new-relic-apm/maintenance/record-monitor-deployments) are labels that, when attached to your application data, help you track deployments and troubleshoot what happened.
204
222
205
-
To create a deployment marker, run the [`apm deployment create`](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_apm_deployment_create.md) command using the same Application ID from your earlier search.
223
+
To create a deployment marker, run the [`apm deployment create`](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_apm_deployment_create.md) command using the same application ID from your earlier search:
Notice that the JSON response includes the revision and timestamp of the deployment. This workflow could be built into a continuous integration or continuous deployment (CI/CD) system to help indicate changes in your application's behavior after deployments.
231
+
Check the JSON response for the revision and timestamp of the deployment.
232
+
233
+
You can build this workflow into a continuous integration or continuous deployment (CI/CD) system to indicate changes in your application's behavior after deployments.
214
234
215
-
Here is an example.
235
+
Here's an example:
216
236
217
237
```json lineNumbers=false
218
238
{
@@ -230,6 +250,6 @@ Here is an example.
230
250
231
251
## Next steps
232
252
233
-
Have a look at [all the available commands](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic.md). For example, you could create a [New Relic workflow](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/core-concepts/new-relic-one-workloads-isolate-resolve-incidents-faster) using [`workload create`](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_workload_create.md)
253
+
Have a look at [all the available commands](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic.md) in the New Relic CLI. For example, you can create a [New Relic workflow](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/core-concepts/new-relic-one-workloads-isolate-resolve-incidents-faster) using [`workload create`](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_workload_create.md)
234
254
235
255
If you'd like to engage with other community members, visit our [New Relic Explorers Hub](https://discuss.newrelic.com/c/build-on-new-relic/developer-toolkit) page. We welcome feature requests or bug reports on [GitHub](https://github.com/newrelic/newrelic-cli).
Change the directory back to `nr1-how-to/create-a-table`. Before you can load the demo application, you need to [update its unique id](https://developer.newrelic.com/build-tools/new-relic-one-applications/guide-to-authentication--data-access--and-permissions) by invoking the New Relic One CLI.
77
77
@@ -131,7 +131,7 @@ import {
131
131
</Step>
132
132
<Step>
133
133
134
-
Add a basic Table component
134
+
Add a basic Table component.
135
135
Locate the empty `GridItem` in `index.js`: This is where you start building the table.
136
136
137
137
Add the initial `<Table>` component. The `items` property collects the data by calling `_getItems()`, which contains sample values.
@@ -145,11 +145,11 @@ Add the initial `<Table>` component. The `items` property collects the data by c
145
145
</Step>
146
146
<Step>
147
147
148
-
Add the header and rows
148
+
Add the header and rows.
149
149
150
150
As the [`Table`](https://developer.newrelic.com/client-side-sdk/index.html#components/Table) component renders a fixed number of header cells and rows, your next step is adding header components, as well as a function that returns the required table rows.
151
151
152
-
Inside of the `Table` component, add the `TableHeader` and then a `TableHeaderCell` child for each heading.
152
+
Inside the `Table` component, add the `TableHeader` and then a `TableHeaderCell` child for each heading.
153
153
154
154
Since you don't know how many rows you'll need, your best bet is to call a function to build as many `TableRows` as items returned by `_getItems()`.
155
155
@@ -184,7 +184,7 @@ Take a look at the application running in New Relic One: you should see somethin
184
184
</Step>
185
185
<Step>
186
186
187
-
Replace standard table cells with smart cells
187
+
Replace standard table cells with smart cells.
188
188
189
189
The New Relic One library includes cell components that can automatically format certain data types, like users, metrics, and entity names.
0 commit comments