AWS Logo
Menu
Setting up Amazon CloudWatch alarms using Q Developer

Setting up Amazon CloudWatch alarms using Q Developer

Quick start for Amazon CloudWatch alarm configuration and management using Q Developer and natural language prompts.

Karthik C
Amazon Employee
Published Jun 10, 2025
Welcome to another installment of Q-Bits, our regular series showcasing cool ways Amazon employees are leveraging Amazon Q Developer. Today, I'm diving in to how Amazon Q Developer helped me quickly setup CloudWatch alarms, explain metric math and anomaly detection, integrate with SNS for notifications, manage alarms and alarm actions using CLI commands.

Introduction

Amazon CloudWatch monitors your Amazon Web Services (AWS) resources and the applications you run on AWS in real time and offers many tools to give you system-wide observability of your application performance, operational health, and resource utilization. Metrics collect and track key performance data at user-defined intervals. Many AWS services automatically report metrics into CloudWatch, and you can also publish custom metrics in CloudWatch from your applications. You can set up alarms that continuously monitor CloudWatch metrics against user-defined thresholds. They can automatically alert you to breaches of the thresholds, and can also automatically respond to changes in your resources' behavior by triggering automated actions.

Prerequisites

To get started you will need the following:
  • An AWS Account
  • AWS CLI configured with your credentials
  • An IDE for your programming language, in this case I am using Visual Studio Code
  • Amazon Q Developer plugin
  • Python 3.7 or later

Getting Started

You will see a screen like below when you first try the Amazon Q Developer in Visual Studio Code, type a ‘/’ in the prompt window to see a list of quick actions.
Amazon Q on Visual Studio Code

Setup CloudWatch alarm and notification:

Here in the prompt window, you can describe what you want to achieve. In this simple example, we will ask Amazon Q to setup a CloudWatch alarm for an OpenSearch domain whenever the cluster status is not GREEN and get notified.
Setup CloudWatch Alarm and notification
Here you see that Amazon Q shared details of the CLI command that you can run to setup CloudWatch alarm for your OpenSearch domain along with the SNS topic that you have to send notifications during an alarm situation. The only change you need to make to this CLI command shared by Amazon Q is to replace the place holder resources [mentioned in CAPITAL letters] with your resources.

Understand Metric Math:

Now if you want to understand a specific feature like CloudWatch Metric Math and leverage it to monitor your Opensearch domain, Amazon Q can help you with multiple suggestions as you can see below. First suggestion is around setting up an alarm around search latency success rate, success rate is calculated based on successful vs total count.
Metric Math feature
Similarly in second and third recommendations, it discusses about setting up alarms around JVM memory pressure and calculated health score based on CPUUtilization & ClusterStatus.
Metric Math feature - continued

Review Anomaly Detection feature:

Now let us review how you can leverage Anomaly detection feature of CloudWatch to help you monitor your OpenSearch domain. In this case, Amazon Q first shares the CLI command that you can leverage to setup an anomaly detection model for the metric and then use it to setup a CloudWatch metric alarm.
Anomaly Detection feature
Similarly, Amazon Q shared multiple other examples to setup anomaly detection models for JVMMemoryPressure, SearchLatency, IndexingLatency which are key cluster operations metrics that can drive an OpenSearch Domain operational health. As shown below, Amazon Q also shares a CLI command to create a CloudWatch Dashboard for the anomaly detection metrics defined. This is where you see that Amazon Q goes above and beyond your initial request of leveraging Anomaly detection and makes it operational for daily use using CloudWatch Dashboards.
CloudWatch Dashboard

Managing CloudWatch alarms:

Similarly you can prompt Amazon Q to help you with CLI commands to manage CloudWatch alarms. In this case Amazon Q suggests CLI commands to list all alarms or specific alarms, modify an existing alarm, enable / disable alarm actions, check alarm state, delete an alarm, and eventually run batch operations like delete multiple alarms or enable actions for multiple alarms. This a powerful way to quick understand and get started on managing alarm life cycle with CLI commands from Amazon Q.
Manage Alarms

Conclusion

Amazon Q Developer can be a powerful tool when managing CloudWatch alarms. Whether you are looking for explanations of specific CloudWatch alarm product features. In this blog, you reviewed on how to use Amazon Q Developer from Visual Studio Code to understand and generate CLI commands to create & manage CloudWatch alarms, deep dive into metric math feature, setup anomaly detection models and use them for specific metrics, setup CloudWatch Dashboard for daily use. To deep dive further please review other features of Amazon Q developer or ask Q about its features, you can also check out Q Developer blogs.
I hope you enjoyed this installment of Q-Bits. If you're looking for more cool ways Amazon employees are leveraging Amazon Q Developer, be sure to click on the Q-Bits tag above.
 

Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.

Comments