MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

How to setup Datadog APM for Java application running with Tomcat

Hand-drawn diagram: Datadog APM tracing a Tomcat Java app on Linux, sent via DD infra agent to cloud

SOURCE FOR APM – https://docs.datadoghq.com/tracing/trace_collection/?tab=containers

This note is applicable for only Host Based APM.

Step 1 – Install Datadog Agent in Centos or Ubuntu or Windows

Step 2 – Install Java Application

# Centos
$ yum install java-11-openjdk-devel

Ubuntu
$ sudo apt-get install openjdk-11-jdk -yCode language: PHP (php)

Step 3 – Install and Run Apache Tomcat

# UBUNTU
$ sudo apt install wget unzip -y

# Centos
$ sudo yum install wget unzip -y

$ cd /opt
$ wget https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.65/bin/apache-tomcat-9.0.65.zip
$ unzip apache-tomcat-9.0.65.zip
Code language: PHP (php)
Datadog Discover APM page with supported languages such as Java, Python, .NET, Go and Node

Step 4 – Download dd-java-agent.jar into /opt/ and give permission.

$ cd /opt
$ wget -O dd-java-agent.jar 'https://dtdg.co/latest-java-tracer'
$ chmod 777 dd-java-agent.jar Code language: JavaScript (javascript)

Step 5 – Edit catalina.sh and following entry

$ vi /opt/apache-tomcat-9.0.65/bin/catalina.sh

# Make sure dd.service and dd.env as per your choice.

CATALINA_OPTS="$CATALINA_OPTS -javaagent:/opt/dd-java-agent.jar -Ddd.profiling.enabled=true -Ddd.logs.injection=true -Ddd.trace.sample.rate=1 -Ddd.service=devopsschool -Ddd.env=prod -Ddd.version=1.1"Code language: PHP (php)

Step 6 – Start Tomcat and Datadog Agent

$ systemctl restart datadog-agent
$ cd /opt/apache-tomcat-9.0.65/bin
$ chmod -R 775 .
$ ./startup.sh
$ ps -eaf | grep tomcat | grep dd
Terminal output of ps -eaf | grep tomcat showing Tomcat running with -javaagent dd-java-agent.jar
Apache Tomcat Examples page on port 8080 with Servlets and JSP examples marked

Step 7 – Generate Traffic using Jmeter on Multiple URL of Tomcat and Example Apps

Apache JMeter HTTP Request sampler sending GET requests to the Tomcat examples path on port 8080

Step – 8 – Review the APM Results

Datadog APM Service List showing two devopsschool Tomcat services with requests, latency and error rate
Datadog APM Traces live search showing devopsschool-tomcat request, latency charts and GET /examples spans

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

Datadog Assignment & Project Master Plan

Target Audience This lab is suitable for: DevOps engineers, SREs, cloud engineers, platform engineers, application engineers, monitoring engineers, and students learning Datadog from practical implementation. Final Outcome…

Read More

Datadog Troubleshooting Master Guide

It covers: Datadog Agent, Kubernetes Agent, Cluster Agent, integrations, logs, APM/traces, custom metrics, DogStatsD, OpenTelemetry, API keys, Terraform, monitors, SLOs, RUM, Synthetics, cloud integrations, cost, permissions, and…

Read More

Datadog FAQ / Interview Questions and Answers — 50 Questions

Below is a Datadog theoretical / approach / capability FAQ set — not MCQ style. These are the kinds of questions that usually come in interviews, internal…

Read More

Datadog Interview Questions and Answer

1. What is Datadog primarily used for? A. Source code version controlB. Infrastructure, application, log, and security observabilityC. Database schema migration onlyD. Static website hosting Correct Answer:…

Read More

What is Datadog: Observability, Monitoring, SIEM, AIOps, Security, and DevOps Platform

Datadog is a SaaS-based observability, monitoring, security, and service-management platform used by DevOps, SRE, platform, application, security, and business teams to understand the health, performance, reliability, cost,…

Read More

Datadog: Single Step APM Instrumentation (SSI) VS Universal Service Monitoring (USM)

Major difference (SSI vs USM) Datadog Single Step APM Instrumentation (SSI) What you get (when it fits) Use cases Not-fit scenarios (from Datadog docs) High-level implementation steps…

Read More