Skip to content

Hunting via the Logs App#

We saw how easy it is to find traces in the Distributed Tracing app. Now let's try a different angle: find the trace, its method, and its code via the Logs app. The Dynatrace Platform is context-aware — it knows which traces write which logs, from which pod, and even which user generated the transaction.

  • Open the Logs App (CTRL + K, then type Logs).
  • Filter on part of the task content, Call the Bugbusters. We're assuming the developer logs the content the user types — and since "we don't know the code", we hunt via logs:
content=*bugbusters*

Logs app

Two log entries match, from the same pod — one added the task, the other duplicated it.

Look closely at the content: the duplicate has the ID and title swapped.

Logs app

To jump to the related distributed trace, either:

  • Right-click the log line → Open record with → Distributed Tracing, or
  • Use the Open trace button above the Topology section in the details pane.

Logs app

Hunting road — Distributed Tracing App#

Via the Distributed Tracing app

To find the trace directly (skipping logs):

  • Filter: "Kubernetes namespace" = todoapp AND "Kubernetes workload" = todoapp Duplicate
  • Look for an incoming request named duplicateTodo.
  • The trace has Code function = duplicateTodo and Code Namespace = com.dynatrace.todoapp.TodoController.
  • Notice the HTTP status is 200 — no failures — yet the app misbehaves. Let's debug the function.

Open the Live Debugger#

  • Search for Code function = duplicateTodo under Code Namespace = com.dynatrace.todoapp.TodoController (type TodoController in search and open the class).
  • Find the duplicateTodo function — declared at line 94.

Duplicate

  • Set a non-breaking breakpoint on line 106.
  • Go to the TODO app and reproduce the bug (duplicate a task).
  • Return to the Live Debugger and open the new snapshot. Review the variables.

Notice how the map items [0] and [1] have their title and UUID swapped? Looking at lines 100 and 101, the setters are assigning the wrong values to each other.

Duplicate

Now the developer can fix the code and resolve the issue. Another bug hunted down 🤩.

Fix the bug and redeploy#

Open TodoController.java, apply your change, then:

redeployApp

Duplicate a task and confirm the copy is correct:

You've now hunted down all three bugs end to end. 🎉