JFR Servlet
A servlet filter that generates JFR events.
<dependency>
<groupId>com.github.marschall</groupId>
<artifactId>jfr-servlet</artifactId>
<version>0.1.2</version>
</dependency>
This project requires Java 11.
Usage
If your web application is not metadata-complete then you only need to add the dependency.
If your web application is metadata-complete
then you manually need to add the filter com.github.marschall.jfr.servlet.JfrFilter
and map it.
<filter>
<filter-name>JfrFilter</filter-name>
<filter-class>com.github.marschall.jfr.servlet.JfrFilter</filter-class>
<async-supported>true</async-supported>
</filter>
<filter-mapping>
<filter-name>JfrFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>ERROR</dispatcher>
<dispatcher>ASYNC</dispatcher>
</filter-mapping>
Correlating Dispatches
A single request may traverse the servlet chain multiple times, either because of a server side redirect or because of asynchronous processing. We generate a unique exchangeId for every request so that multiple dispatches of the same request can be correlated.