Tag your Nerdpack versions to track and subscribe to them. Untag versions to prevent subscriptions or hide Nerdpacks from the catalog.
Update your CLI
Before you run any commands, ensure that you have the latest version of the CLI:
$nr1 update
Check your permissions
To tag a Nerdpack version, you need:
- Access to the account that published it
- The needed permissions for managing Nerdpacks.
Publish your Nerdpack
You need to publish Nerdpacks that you create before you can tag them.
Tag a version
After you've published a Nerdpack version to the New Relic app catalog, you can tag it with the nr1
CLI.
In the root folder of your Nerdpack, run nr1 nerdpack:tag
:
$nr1 nerdpack:tag --tag=DEV✔ Tagged ab123c45-678d-9012-efg3-45hi6jkl7890 version 1.0.0 as DEV.
Here, you tagged version 1.0.0
as DEV
.
Now, you, and other users on your account, can use this tag:
- You see the tag as an option to subscribe to when you add the Nerdpack to your account
- If you subscribe to the
DEV
tag and it gets updated later—say,DEV
is applied to version1.0.1
—you automatically get upgraded to the new version without having to subscribe again.
Important
One of the features of tagging release versions is that users who are subscribed to a tag automatically get updates when that tag is used for another version. This means that if a user is testing one version, say 1.0.0
, and you apply that same tag to another version, say 1.0.1
, that user will see version 1.0.1
in their account, and they can no longer access the Nerdpack they were testing before. Often times, this is the expected behavior, but make sure you consider this side effect when you use tags.
View your Nerdpack's registry information:
$nr1 nerdpack:infoId: ab123c45-678d-9012-efg3-45hi6jkl7890Region: usAccount ID: 1234567Local version: 1.0.0Subscription Model: OWNER_AND_ALLOWEDVersion Count: 1Version Date Tags------- ----------- ----1.0.0 5 hours ago DEV
This output confirms your DEV
tag on version 1.0.0
.
Untag a version
As you build more versions of your Nerdpack, you may update your tags to newer versions. However, you can also remove a tag from your Nerdpack with nr1
.
From your Nerdpack's root directory, view your registry information:
$nr1 nerdpack:infoId: ab123c45-678d-9012-efg3-45hi6jkl7890Region: usAccount ID: 1234567Local version: 1.0.0Subscription Model: OWNER_AND_ALLOWEDVersion Count: 1Version Date Tags------- ----------------- ----2.0.0 a few seconds ago DEV1.0.1 8 minutes ago BETA, STABLE1.0.0 6 hours ago
Here, you see that version 1.0.0
has no tags, version 1.0.1
has two tags, BETA
and STABLE
, and version 2.0.0
has one tag, DEV
.
Remove the BETA
tag from your Nerdpack versions:
$nr1 nerdpack:untag --tag=BETA✔ Removed nerdpack ab123c45-678d-9012-efg3-45hi6jkl7890 tag BETA.
Verify that the tag was removed from your Nerdpack:
$nr1 nerdpack:infoId: ab123c45-678d-9012-efg3-45hi6jkl7890Region: usAccount ID: 1234567Local version: 1.0.0Subscription Model: OWNER_AND_ALLOWEDVersion Count: 1Version Date Tags------- -------------- ----2.0.0 5 minutes ago DEV1.0.1 13 minutes ago STABLE1.0.0 6 hours ago
Resolve issues with tagging a Nerdpack version
Sometimes, when you tag to a Nerdpack version, you may come across issues. Whether you can't tag your Nerdpack or you can't untag your Nerdpack, consider some common solutions for resolving these issues.
Publish your Nerdpack
If you try to tag your Nerdpack without first publishing it, you'll get an error:
$nr1 nerdpack:tag --tag=DEV› Error: A downstream error occurred.
This error message doesn't say much, but you can use the --verbose
option to see more information:
$nr1 nerdpack:tag --tag=DEV --verboseinit version: @oclif/command@1.8.0 argv: [ '--tag=DEV', '--verbose', [length]: 2 ]dist/metadata.json does not exist. package.json will be used instead.Using profile account-1234567Request: POST https://api.newrelic.com/graphqlData: mutation nerdpackTagVersion( nerdpackId: "ab123c45-678d-9012-efg3-45hi6jkl7890", versionTag: tag: "DEV", version: "1.0.0" } ) nerdpackId tags version } }Headers: 'API-Key': '<YOU USER KEY>', 'Content-Type': 'application/graphql'}
This more verbose error message shows the GraphQL that runs behind the scenes for nr1 nerdpack:tag
. The important part of the message here is:
dist/metadata.json does not exist. package.json will be used instead.
The dist
directory is created when you publish your app. So, because it hasn't been published yet, this directory doesn't exist and nr1
falls back to package.json
to look for details about your Nerdpack. But, because the UUID in your package.json
isn't in the New Relic registry, the command failed.
So, before you tag your versions, publish them to the registry:
$nr1 nerdpack:publish$nr1 nerdpack:tag --tag=DEV
Tip
Remember that you can also tag a version at the same time you deploy it!
$nr1 nerdpack:publish --tag=DEV
Unsubscribe from the Nerdpack
You can only remove tags that have no subscribers. If you try to remove a tag that users are subscribed to, you'll get an error:
$nr1 nerdpack:infoId: ab123c45-678d-9012-efg3-45hi6jkl7890Region: usAccount ID: 1234567Local version: 2.0.0Subscription Model: OWNER_AND_ALLOWEDVersion Count: 3Version Date Tags------- ----------- ----2.0.0 an hour ago DEV1.0.1 an hour ago1.0.0 6 hours ago$nr1 nerdpack:untag -t DEV› Error: A downstream error occurred.
In this case, check to see if you're subscribed to the Nerdpack:
$nr1 subscription:listListing subscribed deployed nerdpacks on your account:Version UUID Name Date User------- ------------------------------------ ----------------- ----------- ----------2.0.0 ab123c45-678d-9012-efg3-45hi6jkl7890 MyAwesomeNerdpack an hour ago 1000383529
This shows that you're subscribed to MyAwesomeNerdpack
. Unsubscribe, then try to remove the DEV
tag again:
$nr1 nerdpack:unsubscribeUnsubscribed account 1234567 from the nerdpack ab123c45-678d-9012-efg3-45hi6jkl7890 on the DEV channel.$nr1 nerdpack:untag --tag=DEV✔ Removed nerdpack ab123c45-678d-9012-efg3-45hi6jkl7890 tag DEV.$nr1 nerdpack:infoId: ab123c45-678d-9012-efg3-45hi6jkl7890Region: usAccount ID: 1234567Local version: 2.0.0Subscription Model: OWNER_AND_ALLOWEDVersion Count: 3Version Date Tags------- ----------- ----2.0.0 an hour ago1.0.1 an hour ago1.0.0 6 hours ago