• EnglishEspañol日本語한국어Português
  • Log inStart now

Track changes with GitHub Actions

You can use the New Relic change tracking feature in conjunction with GitHub Actions to monitor the effect of changes on your customers and systems. With GitHub Actions, you can designate which changes to monitor, and then look at the results in the New Relic UI. This allows you to track changes you make in your environment during your release pipeline.

Inputs

Here are the input elements:

Key

Required

Default

Description

guid

yes

n/a

The entity GUID to apply the change marker

apiKey

yes

n/a

Your New Relic personal API key

changelog

no

n/a

A summary of what went into this change that is visible in the Change tracking page

commit

no

n/a

The Commit SHA for this change that is visible in the Change tracking page

description

no

n/a

A high-level description of this change, visible in the Overview page and on the Change tracking page when you select an individual change

deeplink

no

n/a

A deep link to the source which triggered the change

deploymentType

no

BASIC

The type of deployment. Besides the default of BASIC, choose from BLUE_GREEN, CANARY, OTHER, ROLLING, or SHADOW

groupId

no

n/a

A group ID for the change to link to other changes

region

no

US

The region of your New Relic account

version

yes

n/a

Metadata to apply to the change marker, such as the latest release tag

user

yes

github.actor

A username to associate with the change that is visible in the Overview and Deployments pages

Example usage

GitHub secrets

Make sure the following Github secrets are set:

  • NEW_RELIC_API_KEY - Personal API key
  • NEW_RELIC_DEPLOYMENT_ENTITY_GUID - New Relic Entity GUID to create the marker on

Check the New Relic Application Deployment Marker page and click the Use latest version button to make sure you use the latest version available.

There are a number of default GitHub environment variables that are used in these examples as well.

Minimum required fields

name: Change Tracking Marker
on:
release:
types: [published]
jobs:
newrelic:
runs-on: ubuntu-latest
name: New Relic
steps:
# This step builds a var with the release tag value to use later
- name: Set Release Version from Tag
run: echo "RELEASE_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
# This step creates a new Change Tracking Marker
- name: New Relic Application Deployment Marker
uses: newrelic/deployment-marker-action@v2.3.0
with:
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
guid: ${{ secrets.NEW_RELIC_DEPLOYMENT_ENTITY_GUID }}
version: "${{ env.RELEASE_VERSION }}"
user: "${{ github.actor }}"

All input fields

In addition to NEW_RELIC_API_KEY, this example shows how to target multiple items by storing multiple secrets like "NEW_RELIC_DEPLOYMENT_ENTITY_GUID_<ID>", where <ID> is the unique identifier for the target item.

NEW_RELIC_DEPLOYMENT_ENTITY_GUID_App123
NEW_RELIC_DEPLOYMENT_ENTITY_GUID_App456
NEW_RELIC_DEPLOYMENT_ENTITY_GUID_App789
name: Change Tracking Marker
on:
workflow_dispatch:
release:
types: [published]
jobs:
newrelic:
runs-on: ubuntu-latest
name: New Relic
steps:
# This step builds a var with the release tag value to use later
- name: Set Release Version from Tag
run: echo "RELEASE_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
# This step creates a new Change Tracking Marker for App123
- name: App123 Marker
uses: newrelic/deployment-marker-action@v2.3.0
with:
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
guid: ${{ secrets.NEW_RELIC_DEPLOYMENT_ENTITY_GUID_App123 }}
version: "${{ env.RELEASE_VERSION }}"
changelog: "https://github.com/${{ github.repository }}/blob/master/CHANGELOG.md"
commit: "${{ github.sha }}"
description: "Automated Release via Github Actions"
deploymentType: "ROLLING"
groupId: "Workshop App Release: ${{ github.ref_name }}"
user: "${{ github.actor }}"
# This step creates a new Change Tracking Marker for App456
- name: App456 Marker
uses: newrelic/deployment-marker-action@v2.3.0
with:
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
guid: ${{ secrets.NEW_RELIC_DEPLOYMENT_ENTITY_GUID_App456 }}
version: "${{ env.RELEASE_VERSION }}"
changelog: "https://github.com/${{ github.repository }}/blob/master/CHANGELOG.md"
commit: "${{ github.sha }}"
description: "Automated Release via Github Actions"
deploymentType: "ROLLING"
groupId: "Workshop App Release: ${{ github.ref_name }}"
user: "${{ github.actor }}"
# This step creates a new Change Tracking Marker for App789
- name: App789 Marker
uses: newrelic/deployment-marker-action@v2.3.0
with:
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
guid: ${{ secrets.NEW_RELIC_DEPLOYMENT_ENTITY_GUID_App789 }}
version: "${{ env.RELEASE_VERSION }}"
changelog: "https://github.com/${{ github.repository }}/blob/master/CHANGELOG.md"
commit: "${{ github.sha }}"
description: "Automated Release via Github Actions"
deploymentType: "ROLLING"
groupId: "Workshop App Release: ${{ github.ref_name }}"
user: "${{ github.actor }}"

What's next

After you've designated the changes you want to track, you can analyze the effect of those changes in the New Relic UI. For details, see How to view and analyze your changes in New Relic.

Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.