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
javaagentargument with the fully qualified location of the Java agent JAR file when starting the Jetty server. For example:
To use the startup configuration file, edit the
start.inifile 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 jetty.sh file, as follows:
- Open the
jetty.shstart script file.
Add the following
javaagentargument to the beginning of the script.
- Save the script file.
- 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
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.