To demonstrate how to develop, deploy, and manage applications using Jira Software and various connected tools, our team created ImageLabeller, a simple demo application built on AWS that uses machine learning to apply labels to images.
This page covers how to monitor ImageLabeller with Opsgenie. Before you begin, we recommend reading the ImageLabeller architecture and Deploy ImageLabeller with Bitbucketpages for context.
Add an alarms repository for Opsgenie integration
Go to Jira and create a new Jira issue for adding AWS CloudWatch alarms repository to Bitbucket. In this example the Jira issue ID is IM-9.
Go to Bitbucket, and click Create, then Repository.
Select the appropriate Workspace, and Project. Set the Default branch name to mainline. Click Create repository to proceed.
Go to your CloudWatchAlarms repository in your terminal, and run the following to push your AWS CloudFormation template code to Bitbucket.
Set the SNS topic subscription endpoint to the endpoint URL you copied from Opsgenie. The SubmitImageLambdaAlarm monitors a single metric emitted by the submitImage AWS Lambda. If there are more than 10 invocations, a minute the alarm is raised.
bitbucket-pipelines.yml for deploying to AWS
Go to your CloudWatchAlarms repository in your terminal, create a branch named after your Jira issue ID
git checkout -b IM-9
Create a bitbucket-pipelines.yml file with the following yaml. This defines a Bitbucket pipeline for your Test, Staging, and Production environments.
Remember that you need to enable pipelines, setup deployment environments, and add AWS access keys to the repository before pipelines will run.
Pushing to a feature branch
Run the following from the command line to push your changes to the IM-9 branch of your CloudWatchAlamrs repository. Include the Jira issue ID in commit messages, and branch names to enable the Jira Bitbucket integration to keep track of what is happening in your project.