Dynatrace Database-1
Dynatrace Database-1
Leveraging Dynatrace's advanced monitoring capabilities, we can systematically diagnose and resolve the issues
affecting database performance. The following steps outline a comprehensive approach to pinpoint and address the
root causes of slow database transactions.
Step 1: Start with Database Statements Analysis
Dynatrace provides a dedicated area called Top Database Statements for an overview of your database
performance, allowing you to identify any immediate anomalies across database calls.
• Access Top Database Statements: Log into your Dynatrace dashboard, then navigate to the Top Database
Statements section. Here, you can view performance metrics that detail how various database statements
are performing.
• Check for Errors First: Start by scanning for any failing database statements or requests, as these could
indicate a larger issue. If no errors are present, proceed with optimization. It’s reassuring if you find no
failed statements since this lets you focus solely on performance improvement without needing to
troubleshoot fundamental breakdowns.
• Locate Slowest Database Transactions: Investigate further to identify the slowest transaction of the day
by focusing on the outliers. This will highlight the slowest SQL execution and give your insight into the
source of this delay.
We will search for the following transactions:
Check for Errors: First, investigate any failing statements to ensure you’re not dealing with outright database
failures. No failed statements? Great! Now you can focus on optimizing.
Do we have failing database statements?
There is no match which means there are no failed database statements. Which is good. o you have failed database
statements or failed requests in your environment.
🔎 Which is the slowest database transaction of the day? Continue analysing with the outliers Detect the slowest
execution and understand from where this SQL was triggered.
• Filter and Focus: Apply filters, such as > response time, to isolate the transactions with significant delays.
The goal here is to pinpoint the transactions that are noticeably lagging.
We plot by response time and maximum and we continue filtering by adding an operand for > response time.
Then we select the slowest SQL and Click on Outliers.
Here we get an understanding of the distribution of the transactions. Then on the 3 dots, we do a backtrace to
understand who triggered this SQL.
• Trace the Triggering Application and Endpoint: In the backtrace, pinpoint the application (e.g., EasyTravel
Angular) and the endpoint (e.g., /easytravel/rest/journeys/[1-9]) initiating the transaction. This
analysis offers critical insights into specific user actions or workflows that might be causing unexpected
loads on the database
• Determine Triggering Sources: Track back to identify which application or user action (e.g., the
AuthenticationService or a specific API endpoint) is triggering these resource-heavy queries. This analysis
will uncover whether load balancing and request distribution are optimized.
🔎 Which SQL hast the most Fetch count and which the most Row count? Where is this transaction coming from?
Which application and which user action is triggering this SQL?
On the backtrace we notice that this transaction is being triggered directly from the AuthenticationService. By clicking
on each node you get details of those transactions. here we see the different Methods (requests) and its amount
that are triggering such an SQL to the Database. You can also check the instances and validate if the loadbalancing
is done properly and which instance (container, pod, etc..) did that transaction at a specific time.