DEV Community

Cover image for AWS CloudWatch Dashboard Builder - Namespace Template
1

AWS CloudWatch Dashboard Builder - Namespace Template

This is the second post in the CloudWatch Dashboard Builder series. In this post, I'll walk you through the Namespace query template, which is the foundation for the AWS CloudWatch Dashboard Builder tool

The namespace query template defines the metric queries for different AWS services. SQL expressions can be used in metric queries. Examples of queries with and without a SQL expression are provided below.

Image description

Image description

As long as a naming standard is followed, the namespace template can be customized to match your needs. Certain keywords must be retained when modifying or creating a new namespace template for usage with the Cloudwatch dashboard builder tool.

The root object of the namespace template is called "cloudwatch_template" and it is a keyword. Under the root object, you can have multiple child objects, which are called namespaces. Each namespace object has a "schema" name and different "templates". Templates are the unique queries for the namespace. The template contains three keys:

  • name: Name of the template. This name is used as the widget title in the Cloudwatch dashboard.
  • desc: A short description of the template. Tells what the query template does, reports or measures.
  • query: A query that will be executed in Cloudwatch to report on the metrics of the namespace.

The namespace template is located in the template folder. For queries that have double quotes in them, they will need to be escaped for the query to work correctly. So special care needs to be taken when updating or creating the template.

Here is another example of a complex namespace template.

Image description

Now that you're familiar with the Namespace template, we can go on to the last post, which explains how to use the tool.

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Best Practices for Running  Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK cover image

Best Practices for Running Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK

This post discusses the process of migrating a growing WordPress eShop business to AWS using AWS CDK for an easily scalable, high availability architecture. The detailed structure encompasses several pillars: Compute, Storage, Database, Cache, CDN, DNS, Security, and Backup.

Read full post

AWS GenAI LIVE!

GenAI LIVE! is a dynamic live-streamed show exploring how AWS and our partners are helping organizations unlock real value with generative AI.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️