Day 2
=======================================================================================================
Observability
MELT Collect
=======================================================================================================
Metrics LogS Trace
=======================================================================================================
Datadog Agent Datadog Agent APM - Datadog APM Agent(Code)
San - No Agent... Client call from Datadog
RUM - js in your web/app
=======================================================================================================
Platfrom
- Server (Linux + Win)/ Linux(DONE) LINUX LOGS App Performance from Code
- Container/Docker/- Docker DOCKER LOGS Uptime/healthcheck from Endpoint
- Kuberestes APP LOGS RUM from Web/App
- Cloud AWS/Azure/GC Network logs
Web server - Apache
Apache
nginx
IIS
App Server - Tomcat
Tomcat
jboss
web logic
web she
Db server - mysql
mysql
oracle
post
======================= ====================================== ==========================
Infra monitoring logs monitoring App perf monitoring
Network Monitoring Syntectic monitoring
real user monitoring
============================================================================================================
Exploring
==============================================================================================================
Alerts Aka Monitor
==============================================================================================================
Dashboard
===============================================================================================================
Reports
Qs - How to monitor Docker Containers using Datadog using datadog agent?
https://www.devopsschool.com/blog/how-to-enable-docker-container-monitoring-in-datadog-agent/
Step 1 - Get a VM, and Install DataDog agent - DONE
Step 2 - Install Docker and Run Containers
Step 3 - Enable Process Monitoring in DataDog Agent & Restart datadog agent
Step 4 - Enable Datadog Integration(Fresh Account) and Configure Datadog
Step 5 - Check the container metrics at DataDog.
==========================================================================
What is Docker?
What is Container?
Physical ServerS ==> VMs ===> Container
================ ============================= ============================
hypervisors Docker
How to create a vm using virtual box?
Docker
Kubernetes
Step 1 - Get a VM, and Install DataDog agent - DONE
How to install datadog agent in Ubuntu Linux?
Step 2 - Install Docker and Run Containers
Docker Tutorials: How to Install Docker in Ubuntu?
$ sudo apt-get update
$ sudo apt-get install ca-certificates curl gnupg lsb-release
# Add Docker’s official GPG key:
$ sudo mkdir -p /etc/apt/keyrings
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
# Use the following command to set up the repository:
$ echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Install Docker Engine
$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
$ sudo docker ps
$ sudo docker run -itd httpd
$ sudo docker run -itd httpd
$ sudo docker run -itd httpd
$ sudo docker ps
Step 3 - Enable Process Monitoring in DataDog Agent & Restart datadog agent
How to enable Live Process monitoring in Datadog Agent?
# need to edit "Process Collection Configuration" Section
vi /etc/datadog-agent/datadog.yaml
Refer - https://www.devopsschool.com/blog/wp-content/uploads/2022/08/image-24.png
$ systemctl restart datadog-agent
$ systemctl status datadog-agent
# Verify Process
Step 4 - Enable Datadog Integration(Fresh Account) and Configure Datadog - PENDING
Step 5 - Check the container metrics at DataDog. - PENDING
How to monitor Apache using Datadog?
https://www.devopsschool.com/blog/datadog-tutorials-how-to-monitor-apache-using-datadog-in-windows/
How to install & configure Datadog Integration with Apache HTTPD?
Step 1 -> Install Apache
Step 2 -> Enable Apache to expose metrices
Step 3 -> enable Apache Integration at Datadog
Step 4 -> Enable Apache config at Datadog Config
Step 5 -> restart a agent
Step 6 - Validate a metices
Ubuntu - package - apache2
Centosr/- package httpd
60 apt install apache2
61 clear
62 ls
63 clear
64 ls
65 clear
66 sudo /usr/sbin/a2enmod status
67 clear
68 ls
69 cd /etc/datadog-agent/conf.d/
70 ls
71 cd apache.d
72 ls
73 cp conf.yaml.example conf
74 clear
75 ls
76 mv conf.yaml.example conf.yaml
77 ls
78 more conf.yaml
79 vi conf.yaml
80 cler
81 clear
82 systemctl restart datadog-agent
83 datadog-agent status
84 systemctl start apache2
85 systemctl restart datadog-agent
86 datadog-agent status
87 curl http://172.17.0.2/server-status?auto
88 curl http://localhost/server-status?auto
89 clear
90 ls
91 rm -rf conf
92 ls
93 clear
94 ls
95 vi conf.yaml
96 more auto_conf.yaml
97 clear
98 ip a
99 clear
100 ls
101 systemctl restart datadog-agent
102 systemctl status datadog-agent
103 datadog-agent status
104 datadog-agent status | grep apache
105 clear
106 ls
107 history
Day 3
==============================================================================================
==============================================================================================
How to Monitor Java Based App Server? Tomcat using Datadog Agent
https://www.devopsschool.com/blog/how-to-enable-apache-tomcat-monitoring-in-datadog-agent/
==============================================================
Step 1 - Get a VM and Install Datadog Agent - Completed
Step 2 - Install JDK
Java Installation Guide in Linux & Windows
$ sudo apt update
$ sudo apt install openjdk-17-jdk
$ sudo apt install openjdk-17-jre
$ java --version
Step 3 - Install Tomcat
Tomcat Install and Configuration Tutorial and Guide
$ cd /opt/
$ ls
$ wget https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.117/bin/apache-tomcat-9.0.117.zip
$ apt install unzip
$ unzip apache-tomcat-9.0.117.zip
$ cd apache-tomcat-9.0.117
$ cd bin/
$ ls
$ chmod -R 755 .
$ ls
$ pwd
$ ./startup.sh
$ ps -eaf | grep tomcat
Step 4 - Configure DD Agent with Tomcat & Datadog --->
- Go to Integration and Enable Tomcat DONE
- get a config and follow the steps
$ cd /etc/datadog-agent/conf.d/
$ ls
$ cd tomcat.d/
$ ls
$ cp conf.yaml.example conf.yaml
How to enable JMX in tomcat
==============================
$ cd /opt/apache-tomcat-9.0.117/bin
$ vi setenv.sh
CATALINA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9012 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
$ chmod 755 setenv.sh
$ ./shutdown.sh
$ ./startup.sh
- DONT forget to restart Datadog
Step 5 - validate tomcat metrics at Datadog
$ systemctl restart datadog-agent
$ datadog-agent status
How to setup APM using Datadog for Java Applications?
=====================================================
https://www.devopsschool.com/blog/how-to-setup-datadog-apm-for-java-application-running-with-tomcat/
Step 1 - get a vms and install DataDogAgent - DONE
Step 2 - Install JDK - DOEN
Step 3 - Install Tomcat - DONE
Step 4 - Deploy an Application to Tomcat - DONE
Step 5 - Configure APM AGENT for an app/tomcat
$ cd /opt
$ mkdir apm
$ cd apm
$ wget -O dd-java-agent.jar 'https://dtdg.co/latest-java-tracer'
$ cd /opt/apache-tomcat-9.0.117/bin/
$ vi setenv.sh
CATALINA_OPTS="$CATALINA_OPTS -javaagent:/opt/apm/dd-java-agent.jar -Ddd.profiling.enabled=true -Ddd.logs.injection=true -Ddd.trace.sample.rate=1 -Ddd.service=chat -Ddd.env=prod -Ddd.version=1.1"
$
$ chmod -R 777 /opt/apm
CATALINA_OPTS="$CATALINA_OPTS -javaagent:/opt/apm/dd-java-agent.jar -Ddd.profiling.enabled=true -Ddd.logs.injection=true -Ddd.trace.sample.rate=1 -Ddd.service=chat -Ddd.env=prod -Ddd.version=1.1"
$ ./shutdown.sh
$ ./startup.sh
Note - vi /opt/apache-tomcat-9.0.117/webapps/examples/META-INF/context.xml
Step 6 - use An Application
Step 7 - Check the trace at DATADOG AND FINDOUT CULPRIT.

Day 4
==================================
How to collect using Datadog Agent?
https://www.devopsschool.com/blog/datadog-tutorials-log-collection-process-configuration/
Datadog Log: Lab and Assignment
Datadog Tutorials: Send log to Datadog using api through telnet and curl
https://www.devopsschool.com/slides/datadog/datadog-log-monitoring/index.html#/home
Step 1 - Identify the logs which you want to monitor?
/var/log/apache2/access.log
/var/log/apache2/error.log
/var/log/syslog
Step 2 - Install DD agent & Enable logs_enabled: true in datadog.yaml
Step 3 - Create a log config under Datadog
$ cd /etc/datadog-agent/conf.d
$ mkdir custom_log_collection.d
$ vi custom_log_collection.d/conf.yaml
logs:
- type: file
path: /var/log/apache2/access.log
source: apache
service: apache
- type: file
path: /var/log/apache2/error.log
source: apache
service: apache
- type: file
path: /var/log/syslog
source: syslog
service: syslog
$ chown -R dd-agent:dd-agent custom_log_collection.d
$ chmod -R 755 /var/log/
Step 4 - Restart agent
Step 5 - explorer logs at DD