{"id":21679,"date":"2015-06-29T15:09:41","date_gmt":"2015-06-29T09:39:41","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=21679"},"modified":"2016-12-19T15:07:36","modified_gmt":"2016-12-19T09:37:36","slug":"datadog","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/datadog\/","title":{"rendered":"Cloud Infrastructure Monitoring Using Datadog"},"content":{"rendered":"<p>Infrastructure monitoring in the cloud is the topmost priority for any application running in the cloud. This includes monitoring the web servers, databases, applications &amp; various tools being used. Datadog not only provides monitoring but also has alerts integrated so that you get notified for certain type of issues which occur. For example a lot of sudden traffic on your web page.<\/p>\n<p>Datadog is a widely used service that can be integrated\u00a0with almost every cloud service provider, automation tools, databases &amp; other component tools. Datadog also gives you API access &amp; you can create your own monitoring metrics &amp; monitor things from within your application.<\/p>\n<p>Datadog is a very deep tool though, in this blog, we will go through a simple setup of Datadog on an Ubuntu server running \u00a0&amp; monitor various metrics through the Datadog dashboard.<\/p>\n<p>To monitor your entire infrastructure in your AWS account you just need to make a user who has &#8220;Read Only Access&#8221; to your account.\u00a0Also, when working with AWS you would also want that you have a centralized place where you would want to monitor everything in your AWS account. In that case there is an integration &#8220;AWS&#8221; available inside Integrations &#8211; &#8221;<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-22043\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/Screenshot-from-2015-06-25-1624521.png\" alt=\"Screenshot from 2015-06-25 16:24:52\" width=\"1361\" height=\"616\" \/><\/p>\n<p><span style=\"text-decoration: underline;color: #ff6600\"><strong>You can do the following with this integration according to DataDog<\/strong><\/span><span style=\"color: #ff6600\">\u00a0:-<\/span><\/p>\n<ul>\n<li>See automatic AWS status updates in your stream<\/li>\n<li>Get Cloudwatch metrics for EC2 hosts without installing the agent<\/li>\n<li>Tag your EC2 hosts with EC2-specific information (e.g. availability zone)<\/li>\n<li>Get Cloudwatch metrics for other services like ELB or RDS<\/li>\n<li>See EC2 scheduled maintenance events in your stream<\/li>\n<\/ul>\n<p>After installing the integration from the integrations tab you will see Amazon events<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-21739\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/Screenshot-from-2015-06-25-163315.png\" alt=\"Screenshot from 2015-06-25 16:33:15\" width=\"1345\" height=\"459\" \/><\/p>\n<p>Also in the metrics \u00a0tab you would see the various AWS options.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone  wp-image-21740\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/Screenshot-from-2015-06-25-163233.png\" alt=\"Screenshot from 2015-06-25 16:32:33\" width=\"887\" height=\"287\" \/><\/p>\n<p>We would be talking about monitoring later in this post.<\/p>\n<p><span style=\"text-decoration: underline;color: #ff6600\"><strong>Setting up Datadog for a single host manually<\/strong><\/span><\/p>\n<p>We will go ahead with this step considering the fact that you have an Ubuntu server. Also that you have a Datadog account in which you have signed in. Now, we need to install the Datadog Agent. Go to Integrations &amp; then click on Agent. There is a one step command as well as multiple commands for various platforms. Choose Ubuntu &amp; proceed by copying the command &amp; running it in the same server where PHP application is running.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-21681\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/Screenshot-from-2015-06-25-010028.png\" alt=\"Screenshot from 2015-06-25 01:00:28\" width=\"1319\" height=\"585\" \/><\/p>\n<p>You would get a command as shown below:-<\/p>\n<p>[js]<br \/>\nDD_API_KEY=############################## bash -c &quot;$(curl -L ;<br \/>\n[\/js]<\/p>\n<p>Agent is necessary to be installed in order for any monitoring to show up in the Datadog metrics page. Datadog agent will start automatically &amp; if you go to Infrastructure -&gt; Infrastructure list &amp; then Host Map you will see an entry. In Host Map you will see something like below :-<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-21710\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/Screenshot-from-2015-06-25-005943.png\" alt=\"Screenshot from 2015-06-25 00:59:43\" width=\"1316\" height=\"223\" \/><\/p>\n<p>Now, Lets monitor the server metrics. Go to metrics explorer &amp; then choose which ever metric you want.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-21718\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/Screenshot-from-2015-06-25-153701.png\" alt=\"Screenshot from 2015-06-25 15:37:01\" width=\"1304\" height=\"406\" \/><\/p>\n<p>On the right in the graph, if you click the download like button, it will give you many options, one of them being a custom dashboard. In this dashboard you can group all the metrics from one application &amp; can easily access it.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-21730\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/Screenshot-from-2015-06-25-160800.png\" alt=\"Screenshot from 2015-06-25 16:08:00\" width=\"1345\" height=\"451\" \/><\/p>\n<p><span style=\"color: #ff6600\">To check out your new TEST dashboard go to dashboards:-<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-22049\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/Screenshot-from-2015-06-25-1609022.png\" alt=\"Screenshot from 2015-06-25 16:09:02\" width=\"680\" height=\"396\" \/><\/p>\n<p><span style=\"color: #ff6600\">Also you can go into Infrastructure &amp; get more details as below after clicking on the green button in the center of the screen :-<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone  wp-image-21725\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/Screenshot-from-2015-06-25-155012.png\" alt=\"Screenshot from 2015-06-25 15:50:12\" width=\"300\" height=\"207\" \/><\/p>\n<p><span style=\"color: #ff6600\">Click the green button which will take you here<br \/>\n<\/span><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-21724\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/Screenshot-from-2015-06-25-155043.png\" alt=\"Screenshot from 2015-06-25 15:50:43\" width=\"1353\" height=\"542\" \/><\/p>\n<p>You can also go into Infrastructure list which will give you a overall view of all servers. Since we have just one server running Datadog we will see only one entry there :-<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-21727\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/Screenshot-from-2015-06-25-155323.png\" alt=\"Screenshot from 2015-06-25 15:53:23\" width=\"1320\" height=\"264\" \/><br \/>\n( you wont see the Nginx as appearing in this image )<\/p>\n<p>Now, comes alerting for any event you want &amp; for that there is Monitoring. You can monitor individual host machines, integrations, metrics etc. Host monitoring is done as follows :-<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-21728\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/Screenshot-from-2015-06-25-161110.png\" alt=\"Screenshot from 2015-06-25 16:11:10\" width=\"1332\" height=\"569\" \/><\/p>\n<p><span style=\"color: #ff6600\">Below is metric monitoring:-<br \/>\n<\/span><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-21736\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/Screenshot-from-2015-06-25-162135.png\" alt=\"Screenshot from 2015-06-25 16:21:35\" width=\"1308\" height=\"584\" \/>Notifications are sent via mail &amp; also have other integration options like Pager Duty etc.<\/p>\n<p>In my next blog, I shall be telling you how to setup monitoring for you PHP application &amp; Nginx as well.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Infrastructure monitoring in the cloud is the topmost priority for any application running in the cloud. This includes monitoring the web servers, databases, applications &amp; various tools being used. Datadog not only provides monitoring but also has alerts integrated so that you get notified for certain type of issues which occur. For example a lot [&hellip;]<\/p>\n","protected":false},"author":174,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":9},"categories":[1174,7],"tags":[248,1694,1916,1915,4840,1587,1701,2380],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/21679"}],"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\/174"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=21679"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/21679\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=21679"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=21679"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=21679"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}