> Markdown version of [/events/world-congress-2026-europe/sessions/963-how-does-a-java](https://www.wearedevelopers.com/events/world-congress-2026-europe/sessions/963-how-does-a-java). Every page supports `.md` or `Accept: text/markdown`. Links point to the HTML versions so they work for humans too. Agent guide: [/agents.md](https://www.wearedevelopers.com/agents.md). --- # How does a Java agent work? Building a Java agent from scratch. - **Date:** Wednesday, Jul 8, 2026 - **Time:** 16:00–18:00 (120 min) - **Room:** Room M4 (40 Seats) - **Event:** World Congress 2026 Europe ## Description 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. ## Speaker ### [Marco Sussitz](https://www.wearedevelopers.com/@marco-sussitz) Senior Software Developer at Dynatrace ## Related talks at this congress - [Building the Future of Java: AI Agents, MCP, and Next-Gen App Development](https://www.wearedevelopers.com/events/world-congress-2026-europe/sessions/1267-building-the-future) — Daniel Oh - [Context > Models: How to make your agents truly intelligent](https://www.wearedevelopers.com/events/world-congress-2026-europe/sessions/1465-context-models-how) — Florian Wagner, Marc Teipel - [When Agents Meet Legacy: Never Change a Running System](https://www.wearedevelopers.com/events/world-congress-2026-europe/sessions/1364-when-agents-meet) — Michael Friedrich - [Swapping Code, Losing Memory: A JVM Deep Dive](https://www.wearedevelopers.com/events/world-congress-2026-europe/sessions/1365-swapping-code-losing) — Marco Sussitz