Blog
Dynatrace MCP servercoding agent observabilityAI agent production monitoring

How Do You Give a Coding Agent Production Visibility?

Coding agents read your code but can't see what it does live. How an MCP server like Dynatrace's feeds production telemetry into your IDE agent.

Portrait of Luis Chavez-Mattos
Edited by Luis Chavez-Mattos, Director, Product··RSS

For Engineering and IT

A blank code editor window floating on a plain background, with empty panes and no text, standing in for a coding agent that cannot yet see production.

What is the coding agent blind spot, and how do you fix it?

A coding agent can read every file in your project, but it cannot see what that code does once it is running. It has no view of slow queries, failed calls, or an AI agent that quietly does nothing. The fix is to connect the agent to your production telemetry (the logs, metrics, and traces your running system produces). One way to do that is an MCP server, such as the one Dynatrace offers, which lets the agent in your IDE query real runtime data and tie it back to specific lines of code.

TL;DR

  • Coding agents see source code, not behavior. What the code does under real traffic is invisible to them unless you connect that data.
  • A bug with no crash and no error is the hardest kind for an agent to find, because nothing in the code looks wrong.
  • An MCP server can pipe production telemetry into the agent inside your IDE, so you can ask questions about real runs in plain English.
  • In one demonstrated example, an app with response times around 89 seconds was traced from ranked telemetry to one search query reading every row in a table.
  • The recommended fix was a database index with no application code changes.
  • You do not need one specific vendor to apply the idea. Whatever you use, your agent needs a way to see what your code does while it runs.

What does the blind spot look like in practice?

Here is a real example from a creator who builds AI agents. He shipped a new version of an agent that drafts his emails, part of what he calls his AI second brain. It passed his evals (the automated tests used to check an AI system's quality). On its first production run, it looked at two unanswered emails, made zero tool calls, and reported that nothing needed attention.

There was no crash. There was no error message to chase. Nothing in the codebase made the problem obvious to his coding agent. He caught it only because he watched the actual run. Once he saw it, the fix took about seven minutes.

Two lessons sit in that story. First, passing tests does not mean the system behaves correctly in the real world. Second, the problem was found by a human watching, not by the tool that wrote the code. That is the gap. The agent that edits your code has never seen your code run.

Why can't a coding agent see this on its own?

A coding agent works from text: your files, your prompts, and whatever output it gets when it runs commands. Production is a different place. Real data, real traffic, and real databases behave in ways the source code does not show.

Take a normal search query. Read in the code, it looks fine. Whether it is fast or slow depends on how big the table is, which indexes exist, and how often the query is called. None of that is visible in the file. You need real numbers from the running system to know where the time is going.

The same applies to AI agents you build. An agent that decides not to call any tools is not breaking any rule in the code. It is a behavior, and behaviors show up in run traces, not in source files.

What is an MCP server, and why does it matter here?

MCP stands for Model Context Protocol. It is an open standard for connecting AI tools to outside data and services. An MCP server is a small program that exposes a system's data to an AI agent in a form the agent can query.

For this problem, that means your IDE's coding agent can ask a monitoring platform questions directly, instead of you copying charts and logs into the chat by hand. The Dynatrace MCP server is one example. It brings production data from Dynatrace into the agent in your IDE.

The benefit is that one agent now holds both halves of the picture: what the system is doing (telemetry) and why (the source code).

How does production telemetry find a slow line of code?

The Dynatrace walkthrough used an app with response times around 89 seconds. The steps went like this:

  1. Ask a specific question. The prompt asked the agent for the top five methods hitting the database the hardest.
  2. Get a ranked answer from real data. The agent returned the list based on actual telemetry, not a guess.
  3. Connect the data to the code. Because the same agent could read the source, it traced the biggest problems to an exact line.
  4. Name the cause. The culprit was a search query reading every row in the table on every call (often called a full table scan).
  5. Apply the fix. The recommended change was an index on the table, with no application code changes.

Step 4 is the part worth noticing. Reading the code, it is a normal search query. Nothing looks broken. It takes real numbers to show that this is where the CPU is going. An index lets the database jump to matching rows instead of reading all of them, which is why the fix needs no change to the app itself.

How do you set this up for your own project?

The exact setup depends on your IDE and your monitoring platform, so follow the vendor's documentation for installation. The general pattern is the same for any observability tool that offers an MCP server:

  1. Confirm your app already sends telemetry (logs, metrics, traces) to a monitoring platform.
  2. Install or enable the platform's MCP server and register it in your IDE's agent settings.
  3. Grant the access it needs, and prefer read-only access while you are getting started.
  4. Ask a test question about something you already know, to check the answers match reality.
  5. Start asking real questions.

The creator behind the walkthrough said Dynatrace sponsored the video, so treat the specific product as one option and the idea as the takeaway.

What should you ask a production-aware coding agent?

Good questions are specific and tied to something you can act on. Copy and adapt these:

What are the five slowest endpoints in the last 24 hours, and what share of response time does each spend in the database?
Which methods hit the database the hardest? Rank them from telemetry, then find each one in the source code and explain why it is slow.
For the most expensive query, check whether an index would help. Show me the exact line and the change you recommend before editing anything.
Look at the most recent run of the email-drafting agent. Did it make any tool calls? If not, show me the trace and what it saw as input.

The last prompt matters if you build AI agents. A run with zero tool calls is a signal you can check for directly. Ask the agent to flag it, rather than waiting until you happen to watch a run.

Who does this change things for?

Developers using AI coding tools. You can stop being the courier between your monitoring dashboard and your agent. The agent can pull the numbers itself.

People building AI agents. Evals are not enough. You need to look at what agents do in real runs, including cases where they do nothing.

Managers and non-engineers who own an internal tool. You do not need to read traces yourself. You do need to ask your team whether anyone, or any agent, is watching production behavior, and what happens when something is slow but not broken.

What to do this week: pick one app or agent you rely on, check whether it sends telemetry anywhere, and make sure someone looks at real runs after each release. The email agent story shows that a human watching one run caught what the tests missed.

Is there a lighter way to watch what your agents do?

Not every team has an enterprise monitoring platform. If you run a small internal agent, a simple run log can cover the basics: each run recorded with its input, the tool calls it made, and a flag when the count is zero. With Remy, you could describe that tool in plain English and have it build a full-stack app with a database, a dashboard of recent runs, and an email alert for flagged ones. Remy's apps also come with live logs and error tracking. It does not replace a production telemetry platform, but it can give you a place to review agent behavior without another subscription.

Frequently Asked Questions

4 questions

Why did the email agent pass its evals but fail in production?

The sources do not say exactly why, only that nothing in the codebase made the problem obvious. Evals test the cases you thought of in advance. Production brings real inputs and real conditions, and the agent behaved differently there. Watching the actual run is what exposed it.

Does the agent need to change my code to fix a slow query?

Not always. In the demonstrated example, the recommended fix was a database index, with no application code changes. The agent found the problem by combining real telemetry with a reading of the source code.

Do I need Dynatrace specifically?

No. The principle is that your coding agent needs a way to see what your code does when it is running. Dynatrace's MCP server is one way to do that. Check whether your current monitoring tool offers something similar.

Is it safe to give an agent access to production data?

Treat it like any access grant. Start with read-only permissions, limit what data the connection can reach, and review what the agent proposes before it changes anything. The walkthrough covers querying and diagnosing, not letting an agent make unreviewed changes in production.

How we source, write, and correct our articles. Editorial standards

Related articles

Straight to your inbox.
New pieces as they publish. No noise.