{"id":1055,"date":"2025-06-30T08:08:07","date_gmt":"2025-06-30T08:08:07","guid":{"rendered":"https:\/\/blog.vavencloud.com\/?p=1055"},"modified":"2025-06-30T08:08:07","modified_gmt":"2025-06-30T08:08:07","slug":"integrating-datadog-with-aws-for-real-time-monitoring-and-logging","status":"publish","type":"post","link":"https:\/\/blog.vavencloud.com\/?p=1055","title":{"rendered":"Integrating DataDog with AWS for Real-Time Monitoring and Logging"},"content":{"rendered":"<h3 data-start=\"289\" data-end=\"307\">Introduction<\/h3>\n<p data-start=\"308\" data-end=\"736\">DataDog is a powerful monitoring and analytics platform that helps businesses track the performance of their infrastructure. When integrated with AWS EC2, it provides real-time monitoring, allowing you to gain insights into your instances&#8217; performance, troubleshoot issues, and manage logs effectively. In this tutorial, we\u2019ll walk through the steps to integrate AWS EC2 with DataDog and view your logs on the DataDog dashboard.<\/p>\n<p><strong>Prerequisites<\/strong><br \/>\nBefore proceeding, ensure that you have the following:<br \/>\n<em>An active AWS account.<\/em><br \/>\n<em>Access to an EC2 instance.<\/em><br \/>\n<em>A DataDog account (sign up if you don&#8217;t have one yet.<\/em><\/p>\n<p><strong>\u00a0 Step 1: Set Up DataDog API Key<\/strong><br \/>\n1.Log in to your DataDog account.<br \/>\n2.Navigate to the Integrations tab.<br \/>\n3.Under the API Keys section, click on New Key.<br \/>\n4.Copy the generated API Key. You\u2019ll need this for the integration.<\/p>\n<p><strong>\u00a0 \u00a0 Step 2: Install the DataDog Agent on AWS EC2<\/strong><br \/>\nYou can install the DataDog agent on your EC2 instance by following these steps:<\/p>\n<ol>\n<li>SSH into your EC2 instance\n<pre>ssh -i your-key.pem ec2-user@your-ec2-public-ip<\/pre>\n<\/li>\n<li>Update your system.\n<pre>sudo yum update -y<\/pre>\n<\/li>\n<li>Install the DataDog agent<br data-start=\"1502\" data-end=\"1505\" \/>For Amazon Linux 2 (use the appropriate version for your OS):\n<pre>DD_AGENT_MAJOR_VERSION=7 DD_API_KEY=your_datadog_api_key sudo sh -c \"DD_AGENT_VERSION=7.31.1 \\\necho \\\"deb https:\/\/apt.datadoghq.com stable 7\\\" &gt; \/etc\/apt\/sources.list.d\/datadog.list &amp;&amp; \\\ncurl -L https:\/\/www.datadoghq.com\/keys\/datadog.asc | apt-key add -\"\nsudo apt-get install datadog-agent<\/pre>\n<\/li>\n<li>Start the DataDog agent.\n<pre>sudo systemctl start datadog-agent<\/pre>\n<p><strong>Step 3: Verify DataDog Agent Is Running<\/strong><br \/>\nTo verify if the agent is working properly:<\/p>\n<pre>sudo datadog-agent status<\/pre>\n<p><strong>Step 4: Configure Logs to Be Sent to DataDog<\/strong><br \/>\nOnce the agent is installed, you can configure it to send logs from your EC2 instance to DataDog.<\/p>\n<p>1. Enable log collection in the DataDog agent configuration file<br \/>\nOpen the configuration file:<\/li>\n<\/ol>\n<pre> sudo vim \/etc\/datadog-agent\/datadog.yaml<\/pre>\n<p>2.Enable log collection<br \/>\nFind the <em>logs_enabled<\/em> line and set it to<em><strong> true.<\/strong><\/em><\/p>\n<pre>logs_enabled: true<\/pre>\n<p>3. Restart the DataDog agent<\/p>\n<pre>sudo systemctl restart datadog-agent<\/pre>\n<p>4.Configure the log source<br \/>\nNow, configure your EC2 instance&#8217;s log sources to be collected by the agent:<\/p>\n<pre>sudo vim \/etc\/datadog-agent\/conf.d\/&lt;log_source&gt;.yaml<\/pre>\n<p><strong>\u00a0 Step 5: Monitor Logs on DataDog Dashboard<\/strong><br \/>\nOnce the DataDog agent is collecting logs from your EC2 instance, log in to your DataDog\u00a0 \u00a0 \u00a0 \u00a0dashboard, go to the Logs section, and you should see the logs coming from your EC2 instance. You\u00a0 \u00a0can filter, search, and visualize logs to monitor your application performance in real-time.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction DataDog is a powerful monitoring and analytics platform that helps businesses track the performance of their infrastructure. When integrated with AWS EC2, it provides real-time monitoring, allowing you to gain insights into your instances&#8217; performance, troubleshoot issues, and manage logs effectively. In this tutorial, we\u2019ll walk through the steps to integrate AWS EC2 with [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1059,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-1055","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ci-cd-monitoring"],"_links":{"self":[{"href":"https:\/\/blog.vavencloud.com\/index.php?rest_route=\/wp\/v2\/posts\/1055","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.vavencloud.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.vavencloud.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.vavencloud.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.vavencloud.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1055"}],"version-history":[{"count":0,"href":"https:\/\/blog.vavencloud.com\/index.php?rest_route=\/wp\/v2\/posts\/1055\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.vavencloud.com\/index.php?rest_route=\/"}],"wp:attachment":[{"href":"https:\/\/blog.vavencloud.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1055"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.vavencloud.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1055"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.vavencloud.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1055"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}