New integration: Raygun and AWS Code Deploy for better insights into your deployments

| 5 min. (972 words)

Raygun and AWS Code Deploy now work together to provide you with direct support for tracking your deployments. AWS Code Deploy is an automated deployment service and is ideal if you are deploying your applications into EC2.

This latest integration gives detailed insight into the health of each deployment enabling you to monitor any new bugs introduced, regressions and issues still occurring. While tooling to support automated build and deploy have enhanced developer productivity, maintaining high quality software is a key concern for all software development teams.

So with that in mind, I am excited to share this new addition the Raygun PlatformLet’s walk through how to get started.

1. Setting up your deployment

We will start by assuming you are going to get this set up on a new application.

To get started open up the Code Deploy management console and create a new application. On the ‘Create Application’ screen, enter names for your application and code deployment group:

To get started with the Raygun and AWS Code

You will then want to define your EC2 instance configuration and the strategy you are using for your deployments. We typically use a one at a time approach for ours. If you need more information about what you should be configuring for any of the above you can read more in the Code Deploy documentation.

2. Define a trigger for registering your deployment with Raygun

To provide the integration with Raygun we will create a trigger in the ‘Triggers’ section which will perform an API call against Raygun via an SNS topic which is the mechanism provided by Code Deploy for the integration.

Create triggers to start the integration between Raygun and AWS code deploy Click the ‘Create trigger’ button to pop up the trigger dialog and then supply a name (e.g. NotifyRaygun). Set the trigger to fire on the ‘Deployment succeeds’ event and then select the SNS topic you will use for publication. (If you do not already have a topic defined that you want to use, you will want to open the SNS management console and set one up.)

Raygun and AWS Code deploy is easy to set up. You'll need to enter the 'Trigger name' to set things up

By defining this trigger we will be publishing a notification event to the SNS topic when a deployment succeeds. We have chosen only this event because we want only published deployments to be registered in Raygun as these will be the deployments which will be in the field and reporting on crashes.

3. Configure SNS

Now that we have set up the Code Deploy side of things we need to finish by configuring an SNS subscription to call to the Raygun deployment API. This will register the new deployments with Raygun following a successful deployment.

Switch back to the SNS management console and click on the ‘Subscriptions’ section. Add a new subscription by populating the ‘Topic ARN’ field with the ARN for the topic you selected earlier when configuring Code Deploy:

Add a new subscription by populating the ‘Topic ARN’ field to set up Raygun and AWS Code Deploy

You will want to set the protocol to HTTPS and then the Endpoint will be a URI with the following format:

There are two additional pieces of information you will need. The first is the ‘application identifier’ which you can find in Raygun by inspecting the URL when you are inside your dashboard. For my ‘Demo App’, I have used the application identifier ‘abcd’:

cYou will need two things to set up Raygun and AWS Code Deploy

The second piece of information you will need is your ‘external access token’, a unique string which allows for token based authentication under your user account without needing to authenticate via a username or password. To find this you will need to go to your user profile by clicking on the user dropdown in the top right-hand corner of the header and then selecting the ‘My Settings’ link:

Raygun and AWS Code Deploy can be set up by heading to your 'My Settings' tab

On the ‘Profile Settings’ tab scroll down until you find the ‘External Access Token’ section. If you already have set up an external access token you can copy the value you find here, or alternatively you will see a button to generate a new one. We only allow for a single external access token at this time so if you need to rotate these later you can come back and click on the ‘Regenerate Token’ button to rotate this code:

Raygun and AWS Code Deploy is easy to set up

In the above example, my external access token is myPersonalAccessToken

This means that my Endpoint for the SNS subscription will be:

Save the subscription and we are done.

4. Deploy your application and review error trends in Raygun

Now that everything is configured you can start pushing deployments using Code Deploy and they will be registered with Raygun after a successful deployment. To check your deployments you can select the ‘Deployments’ menu item in the Raygun dashboard to bring you to the ‘Recent deployments’ section for your application. Once you have deployments registered they will appear in the list section of this view:

Raygun and Code Deploy show you 'Recent deployments' so you can see where errors are occuring

To start getting better insights on your deployments, and to complete the Raygun and AWS Code Deploy integration, select a deployment from the list and you will come to the ‘Deployment view’ where we correlate errors that have been reported with your deployments and can give you a picture of new errors that have occurred as a result of this deployment. This includes regressions being reported in this deployment and ongoing errors that are continuing to occur. You can use this information to better understand how a deployment has impacted the system health as a whole:

Raygun and AWS Code Deploy work together

Monitor your deployments with Raygun and AWS Code Deploy

Deployments are a platform level concern on our product roadmap that we are intending to continue to evolve over the coming months. Stay tuned for more to come with Raygun and AWS Code Deploy. Until then may all your deployments be health and crash free*!

* As much as that is ever possible in this highly complex distributed software world we now code in 🙂

Do you have any questions or comments about the Raygun and AWS Code Deploy integration? Get in touch with a friendly team member here.