-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into cayla/clear-search
- Loading branch information
Showing
26 changed files
with
1,244 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,5 +34,6 @@ | |
position: absolute; | ||
font-size: 0.85rem; | ||
top: calc(100% + 0.5rem); | ||
right: 0; | ||
z-index: 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
--- | ||
path: '/guides/5-min-tag-resources' | ||
duration: '5 min' | ||
title: 'Quickly tag a set of resources' | ||
template: 'GuideTemplate' | ||
description: 'Add tags to applications you instrument for easier filtering and organization.' | ||
--- | ||
|
||
<Intro> | ||
|
||
[Tags](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/core-concepts/tagging-use-tags-organize-group-what-you-monitor) help you group, search, filter, and focus the data about your [entities](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/core-concepts/what-entity-new-relic), which can be anything from applications to hosts to services. Tagging entities using the New Relic CLI is a good candidate for automation. | ||
|
||
In this 5-minute guide, you are going to use the New Relic CLI to add multiple tags to one of your entities. | ||
|
||
</Intro> | ||
|
||
## Before you begin | ||
|
||
For this guide you need your New Relic [personal API Key](https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys#personal-api-key): Create it at the **Account settings** screen of your New Relic account. | ||
|
||
<Steps> | ||
<Step> | ||
|
||
## Install the New Relic CLI | ||
|
||
You can download the New Relic CLI 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. | ||
|
||
* #### Linux | ||
|
||
With [Snapcraft](https://snapcraft.io/) installed, run: | ||
|
||
`sudo snap install newrelic-cli` | ||
|
||
* #### macOS | ||
|
||
With [Homebrew](https://brew.sh/) installed, run: | ||
|
||
`brew install newrelic-cli` | ||
|
||
* #### Windows | ||
|
||
With [Scoop](https://scoop.sh/) installed, run: | ||
|
||
`scoop bucket add newrelic-cli https://github.com/newrelic/newrelic-cli.git`<br /> | ||
`scoop install newrelic-cli` | ||
|
||
</Step><Step> | ||
|
||
## Create your New Relic CLI profile | ||
|
||
New Relic CLI profiles contain credentials and settings that you can apply to any CLI command. | ||
|
||
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. Don't forget 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). | ||
|
||
```bash lineNumbers=false | ||
# Create the tutorial account for the US region | ||
newrelic profiles add -n tutorial --apiKey API_KEY -r us | ||
# Set the profile as default | ||
newrelic profiles default -n tutorial | ||
``` | ||
|
||
</Step><Step> | ||
|
||
## Search for an entity | ||
|
||
Your New Relic account may have hundreds of entities: Have a quick look by opening the [Entity explorer](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/ui-data/new-relic-one-entity-explorer-view-performance-across-apps-services-hosts). | ||
|
||
In the terminal, run [`entity search`](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_entity_search.md) to retrieve a list of entities from your account as JSON. In the example, you're searching for all entities with "test" in their name. | ||
|
||
```bash lineNumbers=false | ||
# Change the `name` to match any of your existing entities | ||
newrelic entity search --name "test" | ||
``` | ||
|
||
</Step><Step> | ||
|
||
If there are matching entities in your account, the query yields data in JSON format, similar to this workload example. | ||
|
||
Select an entity from the results and look for its `guid` value; the `guid` is the unique identifier of the entity. Write it down. | ||
|
||
```json lineNumbers=false copy=false | ||
{ | ||
"accountId": 123456789, | ||
"domain": "NR1", | ||
"entityType": "WORKLOAD_ENTITY", | ||
"guid": "F7B7AE59FDED4204B846FB08423DB18E", | ||
"name": "Test workload", | ||
"reporting": true, | ||
"type": "WORKLOAD" | ||
}, | ||
``` | ||
</Step><Step> | ||
|
||
## Add tags and tag lists to your entity | ||
|
||
With your entity `guid`, you can add tags right away. You can do so by invoking 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? You can use tag sets for that: While tags are key-value pairs separated by colons, tag sets are comma-separated lists of tags. For example: | ||
|
||
`tag1:value1,tag2:value2` | ||
|
||
<Important>Adding tags is an asynchronous operation: it could take a little while for the tags to get created.</Important> | ||
|
||
```bash lineNumbers=false | ||
# Adding a single tag | ||
newrelic entity tags create --guid GUID --tag key:value | ||
# Adding multiple tags | ||
newrelic entity tags create --guid GUID --tag tag1:test,tag2:test | ||
``` | ||
</Step><Step> | ||
|
||
## Check that the tags are there | ||
|
||
To make sure that the tags have been added to your entities, retrieve them using the [`entity tags get`](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_entity_tags_get.md) command. All tags associated with your entity are retrieved as a JSON array. | ||
|
||
`newrelic entity tags get --guid GUID` | ||
|
||
<Tip> | ||
|
||
Tags can be deleted at any time by invoking the [`entity tags delete`](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_entity_tags_delete.md) command followed by the same arguments you used to create them. | ||
|
||
</Tip> | ||
|
||
|
||
```json lineNumbers=false | ||
[ | ||
{ | ||
"Key": "tag1", | ||
"Values": [ | ||
"true" | ||
] | ||
}, | ||
{ | ||
"Key": "tag2", | ||
"Values": [ | ||
"test" | ||
] | ||
}, | ||
{ | ||
"Key": "tag3", | ||
"Values": [ | ||
"testing" | ||
] | ||
} | ||
// ... | ||
] | ||
``` | ||
</Step></Steps> | ||
|
||
## Next steps | ||
|
||
Have a look at [all the New Relic CLI 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). | ||
|
||
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). | ||
|
||
## Related info | ||
|
||
- [Understanding Entity Explorer (Video)](https://www.youtube.com/watch?v=IGZQup8ZEmE) | ||
- [Tagging: Use tags to organize and group what you monitor](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/core-concepts/tagging-use-tags-organize-group-what-you-monitor) | ||
- [New Relic CLI commands reference](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic.md) | ||
- [New Relic CLI repository on GitHub](https://github.com/newrelic/newrelic-cli) | ||
|
Oops, something went wrong.