The details for instrumenting the Jetty web server with the AppDynamics Java agent vary depending on the version of Jetty you are using, as described on this page.

Instrument Jetty Version 8.x or 9.x

You can instrument Jetty with the AppDynamics agent either from the server startup command or by editing the Jetty startup configuration file.

  •  To add the agent to Jetty at the command line, pass the javaagent argument with the fully qualified location of the Java agent JAR file when starting the Jetty server. For example:

    java -javaagent:/<agent_home>/javaagent.jar -jar start.jar
  • To use the startup configuration file, edit the start.ini file in the Jetty base directory by adding the following lines:


Be sure to specify the location of the AppDynamics javaagent.jar file in the javaagent argument as appropriate for your system. Restart the Jetty server after modifying the configuration file to have your changes take effect.   

Instrument Jetty Version 6.x or 7.x 

For Jetty version 6.x or 7.x, you can add the javaagent command line option to your file, as follows: 

  1. Open the start script file.
  2. Add the following javaagent argument to the beginning of the script.

    java -javaagent:/<agent_home>/javaagent.jar
  3. Save the script file.
  4. Restart the application server for the changes to take effect.

Custom Exclude Rule for WebAppContext

For the Eclipse version of Jetty, to enable AppDynamics to detect business transactions based on web services, you need to create a Servlet exclude rule for the default Jetty servlet org.eclipse.jetty.webapp.WebAppContext

This ensures that AppDynamics can detect business transactions based on the web services provided by your web applications while ignoring unmapped URL or URLs for the underlying framework.