{"id":59587,"date":"2024-01-02T02:17:53","date_gmt":"2024-01-01T20:47:53","guid":{"rendered":"https:\/\/www.tothenew.com\/blog\/?p=59587"},"modified":"2024-01-15T02:21:07","modified_gmt":"2024-01-14T20:51:07","slug":"creating-cloudwatch-dashboards-using-custom-metrics","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/creating-cloudwatch-dashboards-using-custom-metrics\/","title":{"rendered":"Creating CloudWatch Dashboards using Custom Metrics"},"content":{"rendered":"<h2><b>What is\u00a0 CloudWatch Dashboard<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Amazon CloudWatch dashboards are customizable home pages in the CloudWatch console that you can use to monitor your resources in a single view, even those resources that are spread across different Regions. You can use CloudWatch dashboards to create customized views of the metrics and alarms for your AWS resources.<\/span><\/p>\n<h2><b>Problem Statement<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">How to monitor and get the statistics of the custom metrics of your applications and other metrics not provided by AWS by default !!<\/span><\/p>\n<p><b>Solution<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Create a Metric filter for the log group where the logs are being captured for the required data. Create a graph from that metric and add it to the Dashboard.<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">Steps to create a CloudWatch custom Dashboard<\/span><\/h3>\n<ul>\n<li style=\"font-weight: 400;\"><strong>Create a Metric filter<\/strong><\/li>\n<li style=\"font-weight: 400;\"><strong>Create a graph and add it to the Dashboard.<\/strong><\/li>\n<\/ul>\n<h4><strong>Create a metric filter for a log group.<\/strong><\/h4>\n<ol>\n<li><span style=\"font-weight: 400;\">Go to Log Groups inside CloudWatch. Click on the Log group where the required data is being captured. Click on Metrics filters and Create a metric filter.<\/span><\/li>\n<\/ol>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-59579 size-large\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/12\/1-1-1024x309.jpg\" alt=\"\" width=\"625\" height=\"189\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/12\/1-1-1024x309.jpg 1024w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/1-1-300x91.jpg 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/1-1-768x232.jpg 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/1-1-1536x464.jpg 1536w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/1-1-624x189.jpg 624w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/1-1.jpg 1966w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">\u00a02. Enter the pattern that you want to filter in the Filter Pattern field.<\/span><\/p>\n<p><span style=\"font-weight: 400;\"> In the Test Pattern, leave it as Custom log data as shown below, and click <\/span><span style=\"font-size: 1rem;\">on Next.<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-59580 size-large\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/12\/2-1024x727.jpg\" alt=\"\" width=\"625\" height=\"444\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/12\/2-1024x727.jpg 1024w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/2-300x213.jpg 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/2-768x545.jpg 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/2-624x443.jpg 624w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/2.jpg 1180w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">3. Enter the details; you can take reference from the below screenshot and click on Next<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-59581 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/12\/3.png\" alt=\"\" width=\"928\" height=\"842\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/12\/3.png 928w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/3-300x272.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/3-768x697.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/3-624x566.png 624w\" sizes=\"(max-width: 928px) 100vw, 928px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">4. In the next page, we need to review and confirm the metric filter by clicking on save changes<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-59582 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/12\/4.png\" alt=\"\" width=\"950\" height=\"628\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/12\/4.png 950w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/4-300x198.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/4-768x508.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/4-624x412.png 624w\" sizes=\"(max-width: 950px) 100vw, 950px\" \/><\/p>\n<p><strong>Create a graph and add it to the Dashboard<\/strong><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Allow some time to get the traffic populated in that metric filter.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Go to the metric filter which we created in the above steps. And click on Metric values as highlighted in the screenshot below.<\/span><\/li>\n<\/ol>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-59583 size-large\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/12\/6-1024x867.png\" alt=\"\" width=\"625\" height=\"529\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/12\/6-1024x867.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/6-300x254.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/6-768x650.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/6-624x528.png 624w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/6.png 1120w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">3. The page below will appear After clicking on the Metric highlighted above.\u00a0<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-59584 size-large\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/12\/7-1024x343.png\" alt=\"\" width=\"625\" height=\"209\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/12\/7-1024x343.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/7-300x101.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/7-768x258.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/7-1536x515.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/7-624x209.png 624w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/7.png 1920w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Configure the Statistics and other graph options and click \u201cAdd to dashboard\u201d as marked above.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">4. Either select an existing dashboard or create a new dashboard as seen below.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Widget titles can be customized by entering the new title in the below option. <\/span><span style=\"font-weight: 400;\">Click on Add to Dashboard.\u00a0<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-59585 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/12\/8.png\" alt=\"\" width=\"821\" height=\"584\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/12\/8.png 821w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/8-300x213.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/8-768x546.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/8-624x444.png 624w\" sizes=\"(max-width: 821px) 100vw, 821px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">5. After clicking on Add to dashboard, the page below will appear. Click on the save button and the dashboard will be created.<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-59586 size-large\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/12\/9-1024x143.png\" alt=\"\" width=\"625\" height=\"87\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/12\/9-1024x143.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/9-300x42.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/9-768x107.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/9-1536x214.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/9-624x87.png 624w, \/blog\/wp-ttn-blog\/uploads\/2023\/12\/9.png 1915w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<p><strong>Conclusion<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">This blog demonstrates how to create a CloudWatch dashboard using the custom metric filters on the log groups. It helps to visualize the customized data that is being generated in the log groups.<\/span><\/p>\n<div class=\"ap-custom-wrapper\"><\/div><!--ap-custom-wrapper-->","protected":false},"excerpt":{"rendered":"<p>What is\u00a0 CloudWatch Dashboard Amazon CloudWatch dashboards are customizable home pages in the CloudWatch console that you can use to monitor your resources in a single view, even those resources that are spread across different Regions. You can use CloudWatch dashboards to create customized views of the metrics and alarms for your AWS resources. Problem [&hellip;]<\/p>\n","protected":false},"author":1575,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":261},"categories":[4682],"tags":[1266,5584,5585,5583],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/59587"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/1575"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=59587"}],"version-history":[{"count":2,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/59587\/revisions"}],"predecessor-version":[{"id":60050,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/59587\/revisions\/60050"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=59587"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=59587"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=59587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}