World Congress 2026 Europe

How does a Java agent work? Building a Java agent from scratch.

July 8, 2026 16:00 – 18:00 · 120 min Room M4 (40 Seats)

What this session covers

Java agents let you modify application behavior at runtime without changing source code. In this hands‑on workshop, you’ll build a small Java agent from scratch using the Instrumentation API and Byte Buddy. We’ll cover premain vs. attach, class transformers, method interception, and safe argument/return value capture. You’ll see how compiled classes look in bytecode (via javap) and how to reason about performance and classloader/module quirks in modern JDKs. By the end, you’ll have a working agent that times and logs specific methods in a sample app, plus a mental model to understand how tools like OpenTelemetry auto‑instrumentation plug into your services.

Many developers have used a Java agent before, be it in your mocking frameworks, to find a memory leak, or maybe you have some sort of tracing on your backend via OpenTelemetry. But what is a Java Agent, and how does it function? Would you like to know how to manipulate run-time code and achieve things that are impossible otherwise?

In my day-to-day job, I mainly work with Java agents, and in this workshop, I will show you what an agent can do, how they work, and how you can write one yourself.

You’ll build a small Java agent from scratch using the Instrumentation API and Byte Buddy. We’ll cover how to attach your agent, the class transformers, method interception, and argument and return value capture.

In the end, you will know how tools like OTEL work and have a better understanding of observability.

World Congress 2026 Europe

Related talks

Open session

Building the Future of Java: AI Agents, MCP, and Next-Gen App Development

  • Daniel Oh

    IBM

    Senior Principal Developer Advocate

Open session

Context > Models: How to make your agents truly intelligent

  • Florian Wagner

    Microsoft

    Senior Cloud Solution Architect

  • Marc Teipel

    Microsoft

    AI Solution Engineer

Open session

When Agents Meet Legacy: Never Change a Running System

  • Michael Friedrich

    GitLab

    Principal Developer Advocate

Open session

Swapping Code, Losing Memory: A JVM Deep Dive

  • Marco Sussitz

    Dynatrace

    Senior Software Developer

All sessions at this congress