Try it free

Investigate database performance and dependencies in Services

  • Latest Dynatrace
  • Tutorial
  • 6-min read
  • Published Aug 20, 2026

Dynatrace captures every database call your services make as a span and surfaces the aggregated data in Services Services. This tutorial shows you how to go beyond the built-in views: use Dynatrace Query Language (DQL) to analyze query performance, track call volume, and identify unmonitored databases, as well as navigate database dependencies directly in Services Services.

For an explanation of how database calls are captured, see Database query monitoring in Services.

Who is this for?

This tutorial is designed for developers, SREs, and platform engineers who need to investigate database performance issues, understand which databases their services depend on, build database-centric dashboards, or identify gaps in database monitoring coverage.

What will you learn?

By the end of this tutorial, you'll know which databases your services depend on, how to surface slow or failing queries, and which databases aren't yet covered by monitoring.

In this tutorial, you'll learn how to:

  • Navigate database dependencies in Services Services.
  • Analyze database query performance and track call volume using DQL.
  • Discover unmonitored databases and prioritize which ones to onboard first.

Before you begin

Prerequisites

  • Services instrumented with OneAgent or OpenTelemetry
  • Access to Services Services with the minimal set of permissions
  • Access to Notebooks Notebooks or Dashboards Dashboards to run DQL queries

Prior knowledge

Basic familiarity with DQL is helpful but not required, as DQL examples are provided throughout the documentation.

Explore database monitoring in Services Services

Access the Database queries view and Service Map in Services Services to investigate database dependencies, analyze query performance, and discover databases that aren't yet monitored.

View queries made by a particular service

To get a list of all queries executed by a particular service

  1. Go to Services Services > Explorer.
  2. Find the required service.
  3. From the service details panel, go to the Database queries tab.

The database queries of this service are listed, along with insights into query count per minute, query duration, and error rate.

View queries made by all services

To get a list of all queries executed across all your services

  1. Go to Services Services > Explorer.

  2. In the sidebar panel on the left, select Database queries.

  3. Optional In the Type to filter field on top of the service list, use the db.system and db.namespace attributes to filter for the relevant database.

    For example, enter db.system = mysql AND db.namespace = memberships to view the list of queries made by the MySQL database named memberships.

The Database queries view provides a cross-service perspective.

Navigate to Databases Databases for a monitored database

When a database is monitored and linked to a Dynatrace entity, you can navigate directly from the Database queries view in Services Services to its full details in Databases Databases.

To open the database details in Databases Databases

  1. Go to Services Services > Explorer (Early Access).

  2. In the sidebar panel on the left, select Database queries.

  3. Select (Action menu) > Databases View in Databases in the row (the last column where you see icons).

    The corresponding database instance is opened in Databases Databases.

You can also go to the database-related apps from the Service Map in Services Services. For details, see Drill down to traces, logs, and more.

Discover and onboard unmonitored databases with Service Map

To identify unmonitored databases using the Service Map in Services Services

  1. Go to Services Services > Explorer (Early Access).
  2. Select Map in the view toggle located in the upper-right corner above the service list.
  3. Explore the database nodes. For the unmonitored databases, the This database instance is unmonitored message appears in the node details.
  4. From the details of the required unmonitored database, select Databases Add database instance and follow the guided hints to activate a database extension or cloud monitoring.

You can also find unmonitored databases using the DQL query based on the dt.service.database.query.count metric. For details, see Discover unmonitored databases using query count metric.

Query database data with DQL

Run the provided DQL queries in Notebooks Notebooks or create database-centric dashboards in Dashboards Dashboards to analyze database query performance, track call volume by database entity, and discover unmonitored databases.

Analyze database query performance

Use the following DQL query to show the slowest or most error-prone queries across a service or your entire environment.

fetch spans
| filter span.kind == "client" and isNotNull(db.system)
| summarize totalCalls = count(),
avgDuration = avg(duration),
errorRate = countIf(status.code == "ERROR") / count() * 100,
by: { dt.smartscape.service, db.system, db.namespace, db.query.text, db.operation.name }
| sort avgDuration desc

Track database call volume

Run the following DQL query to see database entities a service communicates with, including the call volume over time. The db_entity field shows either the ID of a monitored AWS RDS or MySQL database or states if the database is unmonitored.

timeseries calls = sum(dt.service.database.query.count),
by: { dt.smartscape.service, db.system, db.namespace,
dt.smartscape.aws_rds_dbinstance,
dt.smartscape.db_instance_mysql
}
| fieldsAdd db_entity = coalesce(dt.smartscape.aws_rds_dbinstance, dt.smartscape.db_instance_mysql, "Unmonitored database")
| fieldsRemove dt.smartscape.aws_rds_dbinstance, dt.smartscape.db_instance_mysql

Discover unmonitored databases using query count metric

As the dt.service.database.query.count metric is emitted for every database a service calls (regardless of whether it's monitored or not), you can use it to identify coverage gaps in database monitoring.

Use the following DQL query to retrieve databases referenced in traces but not backed by a monitored entity, ranked by the number of services calling them.

timeseries calls = sum(dt.service.database.query.count),
by: { dt.smartscape.service, db.system, db.namespace,
dt.smartscape.aws_rds_dbinstance,
dt.smartscape.db_instance_mysql
}
| fieldsAdd db_entity = coalesce(dt.smartscape.aws_rds_dbinstance, dt.smartscape.db_instance_mysql)
| filter isNull(db_entity)
| summarize callingServices = count(), by: { db.system, db.namespace }
| sort callingServices desc

You can rely on this DQL query to prioritize which databases to onboard first: the databases called by the most services represent the highest-impact monitoring gaps. For such databases, activate a matching database extension or cloud monitoring integration to create the entity and link it into the topology.

You can also uncover unmonitored databases using the Service Map in Services Services. For details, see Discover and onboard unmonitored databases with Service Map.

Congratulations!

You've completed this tutorial. You now know how to investigate database dependencies and performance using DQL and Services Services. You can:

  • View database queries in Services Services, from a per-service view to a cross-service perspective.
  • Open monitored databases in Databases Databases for deeper analysis.
  • Surface your slowest and most error-prone database queries across services.
  • Track database call volume over time.
  • Identify which databases are not monitored.

As your environment evolves, revisit the DQL queries in this tutorial to adapt them to new database technologies or broader coverage requirements. To learn more about the underlying data model, see Database query monitoring in Services.

Related topics

  • Database query monitoring in Services
Related tags
Application ObservabilityServicesServices