The change tracking feature is a good way to monitor the effects of specific changes on your customers and systems. You do this by designating which changes you want to monitor and then viewing the results in the New Relic UI.
While you can designate which changes you want to monitor by using GraphQL or a CI/CD integration, you can also use our CLI to do the same thing. If you use the CLI to designate the changes you want to monitor, you can run either a GraphQL query or execute an NRQL query against the New Relic database to retrieve a list of those changes.
Prerequisites
- Ensure that you have New Relic CLI version
0.104.5or higher. Follow the install or upgrade documentation to get latest version.
Make a change marker with the CLI
The CLI has a range of options (shown below), but the create command marks a specific change for a given New Relic entity.
This is the syntax to create a marker:
$newrelic changeTracking create [flags]Examples:
Primary (parent) options
--category string category of event, e.g., DEPLOYMENT, CONFIG_CHANGE, etc. category is required. --changelog string changelog for the deployment --commit string commit hash for the deployment --customAttributes string custom attributes: use '-' for STDIN, '{...}' for inline JS object, or provide a file path --deepLink string deep link URL for the deployment --description string a description of the event --entitySearch string the NRQL entity search query for this event. Example: name = 'MyService' AND type = 'SERVICE' (required) --featureFlagId string ID of the feature flag --groupId string string that can be used to correlate two or more events-h, --help help for create --shortDescription string short description for the event-t, --timestamp int the time of the event, the number of milliseconds since the Unix epoch, defaults to now --type string type of event, e.g., BASIC, ROLLBACK, etc. type is required. --user string username of the actor or bot --validationFlags strings comma-separated list of validation flags, e.g. ALLOW_CUSTOM_CATEGORY_OR_TYPE,FAIL_ON_FIELD_LENGTH,FAIL_ON_REST_API_FAILURES --version string version of the deploymentOptions inherited from parent commands
-a, --accountId int the account ID to use. Can be overridden by setting NEW_RELIC_ACCOUNT_ID --debug debug level logging --format string output text format [JSON, Text, YAML] (default "JSON") --plain output compact text --profile string the authentication profile to use --trace trace level loggingThis is the syntax to create a marker:
$newrelic entity deployment create [flags]Here's an example:
$newrelic entity deployment create --guid INSERT_YOUR_GUID_HERE --version <1.0.0>Primary (parent) options
-h, --help help for create-g, --guid string the entity GUID to create change tracker-v, --version string the tag names to add to the entity --changelog string a URL for the changelog or list of changes if not linkable --commit string the commit identifier, for example, a Git commit SHA --deepLink string a link back to the system generating the deployment --deploymentType string type of deployment, one of BASIC, BLUE_GREEN, CANARY, OTHER, ROLLING or SHADOW --description string a description of the deployment --groupId string string that can be used to correlate two or more events-t --timestamp int64 the start time of the deployment, the number of milliseconds since the Unix epoch, defaults to now-u --user string username of the deployer or botOptions inherited from parent commands
-a, --accountId int the account ID to use. Can be overridden by setting NEW_RELIC_ACCOUNT_ID --debug debug level logging --format string output text format [JSON, Text, YAML] (default "JSON") --plain output compact text --profile string the authentication profile to use --trace trace level logging