Prometheus Monitoring for Java Web Applications w o Modifying Source Code
summary
Creates a Java agent that injects Prometheus counters into servlet code at class-load time using Byte Buddy, instruments javax.servlet.Servlet.service to increment a labeled counter for the request path, and starts a tiny HTTP exporter so metrics appear at /metrics on :9300. Works against WildFly (and also Tomcat/Spring Boot), demo shows counters incrementing on each request. Notes: must expose agent packages to app server classloader (JBoss module tweak) and use thread‑locals to avoid double counting when servlets forward.
AI-written summary · about
chapters (9)
- 0:00Prometheus monitoring intro
- 1:08What is a Prometheus metric
- 6:02Instrumenting Java apps
- 12:30Monitoring without code changes
- 13:33How Java agents work
- 16:22Byte Buddy for bytecode
- 18:49Demo of Java agent
- 23:28Advanced use cases
- 27:48Q&A and server setup
related talks
48mState of the Java Metrics Libraries
44mDo It Yourself: Programmable Metrics using OpenTelemetry
49mOpenTelemetry for Java Developers
37mMake your Java application observable with no code changes using OpenTelemetry
30mMonitor your application performances using InspectIT APM
52mIs your JVM app flying blind? Unmask hidden issues with Observability superpowers!
01h 10mObservability For (Java) Devs - 2023 Edition
56mIntroduction to Spring Boot Application monitoring
