The Servlet Sensor traces relevant information which is transferred over a Java HTTP servlet. It also traces web application name, and the name of the servlet executed for this request.
The Servlet Sensor captures the following info:
|Request Size in bytes||high|
|Response Size in Bytes||high|
To edit the System Profile specific settings, open the System Profile Preferences dialog box and select Agent Group/tier with Java technology > Sensor Configuration and then select the Servlets item in the Sensor Configuration list.
Here you can enable or disable measure of the request/respond sizes. You can use this info in charts or other dashboards.
- Measure Request/Response Sizes (): Capture the sizes of request and response in bytes.
- Always add Dynatrace header to responses: Force adding the AppMon header to responses, even if it was not available in the request (useful for Load-Test scenarios). You cannot change this value if a DC-RUM appliance is configured. See Integration for details.
- Capture Details in all Filters and Servlets (): If disabled, details like session attributes or request headers are only captured for the first filter/servlet call on a path. If enabled, the details are captured for each filter/servlet call. You can add additional attributes to the initial set of attributes, especially in cascading filter calls. To capture these additional attributes you must enable this property.
You can filter captured data by URI. There are two possible scenarios:
- Capture listed URIs only.
- Capture all URIs, except for the listed ones.
Select the appropriate option button and list URIs or URI patterns to be included/excluded from the capture.
Parameters and attributes
You can capture certain parameter and attributes values like request headers, session attributes, request attributes, and request parameters as strings. To specify a captured attribute explicitly, provide its name in the Attribute column. To capture an attribute that contains a certain name, provide a partial name in the Attribute column. To capture all available attributes, leave the Attribute column empty or type '*'. Keep in mind that may cause a high overhead, Dynatrace does not recommend usage of wildcards in production environments.
Properties marked with are especially relevant for sensor overhead on the system under diagnosis (SUD). Use these properties with caution and check the impact on the SUD after setting these properties.
You can use the Parameters and Attributes table to configure the Sensor to capture the following Source types:
- Request Parameter: Captures the form parameters of the request if the given tring is a substring of the parameter's name.
- Request Attribute: Captures the servlet request attribute for this request if the given string is a substring of the servlet request attribute name.
- Session Attribute: Captures the session item for this request if the given tring is a substring of the session item's name.
- Request Header: Captures the HTTP headers sent with the request if the given tring is a substring of the header's name.
For Tomcat and WebLogic platforms, servlets providing static content like images are excluded from diagnosis by default. However, the method
doFilter is instrumented, which may result in creation of PurePaths for servlets that create static content on other platforms. To exclude such servlets, which usually listen on a URI ending with an image name, add exclusion rules for the expected image types to the Servlet Sensor Properties, as shown in the following figure.
Asynchronous servlet execution support
The Sensor supports asynchronous servlet execution as specified in the Servlet 3.0 specification. This feature requires that the Executor Tagging Sensor be placed and active. Asynchronous execution time — the time between ServletRequest.startAsync() and AsyncContext.complete() — is available as Web Request Response Time in the PurePaths dashlet and the Web Requests dashlet. If multiple asynchronous executions are started on a Pure Path, the Web Request Response Time is calculated from the first call of
ServletRequest.startAsync() to the last call of
PurePaths and web requests containing asynchronous execution elements are visualized with the status symbol
Play Framework support
The Servlet sensor also handles Play Framework support of the play framework. However, as Play does not implement the Servlet API, the sensor handles only Play Java Actions. Static content or asynchronous requests are not supported. The same properties as for Servlets are captured.