{"id":47,"date":"2014-05-16T10:29:00","date_gmt":"2014-05-16T10:29:00","guid":{"rendered":"http:\/\/blogtest.com\/?p=47"},"modified":"2025-10-16T18:54:42","modified_gmt":"2025-10-16T18:54:42","slug":"custom-metric-in-amazon-cloudwatch","status":"publish","type":"post","link":"https:\/\/www.metaoption.com\/blog\/cloud-development\/custom-metric-in-amazon-cloudwatch\/","title":{"rendered":"Custom Metric in Amazon CloudWatch"},"content":{"rendered":"<p style=\"text-align: justify;\"><span style=\"font-family: tahoma, arial, helvetica, sans-serif; font-size: small;\">Amazon CloudWatch is an Amazon Web Service (AWS) utility tool, which allows monitoring of various components like EC2 instance, Elastic load balancer and EBS volumes. One can also monitor CPU utilization, disk read byte, disk writes byte, networking in and networking out for EC2 instance with its support.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: tahoma, arial, helvetica, sans-serif; font-size: small;\">Amazon CloudWatch provides custom metrics to avoid various problems. With the help of Amazon CloudWatch, one can simply define the custom metric based on one&#8217;s individual need or requirements. And one can also update it at regular intervals. <\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: tahoma, arial, helvetica, sans-serif; font-size: small;\">This can be simply demonstrated by using an example of a free memory. The main objective in this instance is to define a custom metric for a free memory and constant input the data to the metric using the machine which needs to be monitored.<\/span><\/p>\n<ul style=\"text-align: justify;\">\n<li><span style=\"font-family: tahoma, arial, helvetica, sans-serif; font-size: small;\">INSTALL &#8211; install\/setup the AWS cloud-watch Command line from https:\/\/aws.amazon.com\/developertools\/2534<\/span><\/li>\n<\/ul>\n<ul style=\"text-align: justify;\">\n<li><span style=\"font-family: tahoma, arial, helvetica, sans-serif; font-size: small;\">Setup the API as you would for any AWS Command line tool<\/span><\/li>\n<\/ul>\n<ul style=\"text-align: justify;\">\n<li><span style=\"font-family: tahoma, arial, helvetica, sans-serif; font-size: small;\">Export JAVA_HOME=\/usr\/lib\/jvm\/java-6-openjdk\/jre\/<\/span><\/li>\n<\/ul>\n<ul style=\"text-align: justify;\">\n<li><span style=\"font-family: tahoma, arial, helvetica, sans-serif; font-size: small;\">Export AWS_CLOUDWATCH_HOME=\/opt\/cloudwatch\/ or the location where you have unzipped the utility<\/span><\/li>\n<\/ul>\n<ul style=\"text-align: justify;\">\n<li><span style=\"font-family: tahoma, arial, helvetica, sans-serif; font-size: small;\">Export PATH=$AWS_CLOUDWATCH_HOME\/bin:$PATH;<\/span><\/li>\n<\/ul>\n<ul style=\"text-align: justify;\">\n<li><span style=\"font-family: tahoma, arial, helvetica, sans-serif; font-size: small;\">To define a new metric eg. Free Memory,<\/span><\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><span style=\"font-family: tahoma, arial, helvetica, sans-serif; font-size: small;\">ubuntu@domU-12-41-32-0B-01-A7:~$ mon-put-data -m &#8220;FreeMemory&#8221; &#8211;namespace metaoption &#8211;dimensions &#8220;instance=i-f23233,servertype=MongoDB&#8221; &#8211;value 100 -u Bytes<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: tahoma, arial, helvetica, sans-serif; font-size: small;\">The command will create a free memory in the next 20 minutes, with the customized namespace and dimensions, set as per your needs. For the instance, we have to choose a dummy value and the unit we choose is bytes.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: tahoma, arial, helvetica, sans-serif; font-size: small;\">For more information please go through the link:<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #0000ff;\"><strong><span style=\"font-family: tahoma, arial, helvetica, sans-serif; font-size: small;\">https:\/\/docs.amazonwebservices.com\/AmazonCloudWatch\/latest\/DeveloperGuide\/index.html?CLIReference.html<\/span><\/strong><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: tahoma, arial, helvetica, sans-serif; font-size: small;\">Once it is created, we need to continuously update the data to the metrics that contain information about the current memory status of the system and can be used as the data source.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: tahoma, arial, helvetica, sans-serif; font-size: small;\">Deleting Custom Metrics:<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: tahoma, arial, helvetica, sans-serif; font-size: small;\">A cloud metric will be automatically deleted once it remains unused for 2 weeks.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: tahoma, arial, helvetica, sans-serif; font-size: small;\">Pricing: $ 0.50 per metric per month<\/span><\/p>\n<p style=\"text-align: justify;\">\n","protected":false},"excerpt":{"rendered":"<p>Amazon CloudWatch is an Amazon Web Service (AWS) utility tool, which allows monitoring of various components like EC2 instance, Elastic load balancer and EBS volumes. One can also monitor CPU utilization, disk read byte, disk writes byte, networking in and networking out for EC2 instance with its support. Amazon CloudWatch provides custom metrics to avoid\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.metaoption.com\/blog\/cloud-development\/custom-metric-in-amazon-cloudwatch\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_eb_attr":"","footnotes":""},"categories":[7],"tags":[],"class_list":["post-47","post","type-post","status-publish","format-standard","hentry","category-cloud-development"],"featured_image_src":false,"rttpg_featured_image_url":null,"rttpg_author":{"display_name":"MetaOption","author_link":"https:\/\/www.metaoption.com\/blog\/author\/admin\/"},"rttpg_comment":0,"rttpg_category":"<a href=\"https:\/\/www.metaoption.com\/blog\/category\/cloud-development\/\" rel=\"category tag\">Cloud Development<\/a>","rttpg_excerpt":"Amazon CloudWatch is an Amazon Web Service (AWS) utility tool, which allows monitoring of various components like EC2 instance, Elastic load balancer and EBS volumes. One can also monitor CPU utilization, disk read byte, disk writes byte, networking in and networking out for EC2 instance with its support. Amazon CloudWatch provides custom metrics to avoid\u2026&hellip;","_links":{"self":[{"href":"https:\/\/www.metaoption.com\/blog\/wp-json\/wp\/v2\/posts\/47","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.metaoption.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.metaoption.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.metaoption.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.metaoption.com\/blog\/wp-json\/wp\/v2\/comments?post=47"}],"version-history":[{"count":0,"href":"https:\/\/www.metaoption.com\/blog\/wp-json\/wp\/v2\/posts\/47\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.metaoption.com\/blog\/wp-json\/wp\/v2\/media?parent=47"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.metaoption.com\/blog\/wp-json\/wp\/v2\/categories?post=47"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.metaoption.com\/blog\/wp-json\/wp\/v2\/tags?post=47"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}