Dynatrace Notebooks let you combine live data, executed code, and narrative to explore and diagnose issues within your environment.

Here’s a live example. Imagine we’re investigating a sudden spike in user-reported errors. We’ll start by pulling up a dashboard that shows key performance indicators.

# This is a placeholder for actual Dynatrace API calls.
# In a real notebook, you'd use the Dynatrace Python client or similar.

from dynatrace import DynatraceAPI

dt = DynatraceAPI("YOUR_TENANT_URL", "YOUR_API_TOKEN")

# Fetch service health over the last hour
services_health = dt.services.get_health(timeseries="errorCount", start="-1h")

# Fetch user session data for the same period
user_sessions = dt.user_sessions.get_data(metrics=["session_count", "error_rate"], start="-1h")

print("Service Health Data:", services_health)
print("User Session Data:", user_sessions)

This code snippet, when executed within a Dynatrace Notebook, would fetch real-time data directly from your Dynatrace tenant. We’re looking at errorCount for services and session_count and error_rate for user sessions. The output would be structured data, ready for analysis.

The core problem Dynatrace Notebooks solve is bridging the gap between static dashboards and interactive, code-driven investigation. Traditional monitoring shows you what happened; notebooks let you ask why it happened, right there and then, using live data.

Internally, a Dynatrace Notebook is a Jupyter-like environment. It has a Python kernel that can authenticate with your Dynatrace tenant using API tokens. You can then use Dynatrace’s extensive API to query metrics, traces, logs, and even trigger actions. The notebook stores the executed code, its output (tables, charts, raw data), and your explanatory text, creating a reproducible record of your investigation.

The key levers you control are the Dynatrace API calls themselves. You can filter by specific services, hosts, or applications, adjust timeframes with granular precision (down to the minute), and select the exact metrics relevant to your problem. For instance, instead of just errorCount, you might query request_duration_p95 or cpu.usage to correlate different system behaviors.

One thing most people don’t realize is the power of combining Dynatrace’s AI-driven insights (like "Problem" notifications) with programmatic exploration. You can use a notebook to automatically fetch all related entities and metrics for a triggered problem, then write custom Python code to analyze the specific root cause suggested by the AI, drilling down into trace data or logs that might not be immediately visible on a standard dashboard. This allows for much deeper, targeted root-cause analysis than simply acknowledging an alert.

The next step after this is to start integrating automated diagnostic workflows, where notebooks can be triggered by specific events or alerts to perform predefined investigations.

Want structured learning?

Take the full Dynatrace course →