Http Sensor

Available with version 1.3

Overview

The http sensor allows to keep track of http related information within your application. Each http based request that your application gets will be displayed and measured. You get the request URI, all headers, parameters and attributes that were provided with the request. As the http sensor also captures the time each request took you get a very good overview about which http operation took the most time in your system. As the http sensor also fully supports navigation you can easily navigate to the invocation sequences that were executed for each http request and thus diagnose a problematic runtime with ease.

The http sensor only provides one measurement per invocation. Think of it like that: If you instrument a Filter Chain which in fact passes the request from one filter to the next filter you do not want to have multiple http timers measured as this would complicate analysis later. Just think what an approach like that would mean: You would get multiple http timers for one request. The aggregate view will thus show the calls to some specific URL multiple times (a higher count value) than it really happened (it only happened once).

Please see the WORKING WITH ... pages for further information of how the http timer can be used to monitor and diagnose your system.

Configuration

The http sensor needs to be defined in order to use it. This definition is already available within the sample inspectIT configuration file. In addition to just defining the sensor type, you can configure which data the http sensor should capture.

method-sensor-type http info.novatec.inspectit.agent.sensor.method.http.HttpSensor MAX

Enabling session attribute capturing

The Http sensor can capture information about the http session that is currently associated with the respective request. In the current realization the http sensor always captures the session attributes at the start of the invocation. In order to activate this capturing you need to specify the "sessioncapture" configuration setting to true. This capturing is disabled by default. Session capturing will never open a new http session, but just read data from an existing one.

method-sensor-type http info.novatec.inspectit.agent.sensor.method.http.HttpSensor MAX sessioncapture=true

Sensor assignment

Usually you do not need to change the assignment of the http sensor as inspectIT provides an out-of-the-box assignment for the http sensor. You can have a look at this instrumentation at the file http.cfg in the Out-of-the-box instrumentation. If you want to make additional assignments, please be aware of the following rules:

  • The http sensor assumes that it is attached to methods that provide a ServletRequest object as first parameter. It will check if the given parameter is in fact also realizing HttpServletRequest as only this will provide the necessary http information. If the object does not realize this interface, nothing will be done
  • If you attach the sensor to a method that does not provide a HttpServletRequest (as runtime class of the object) within the first parameter, the sensor will never provide any information at all.

Other options

String length

from version 1.3

This sensor enables the limitations of the string values collected. The HTTP sensor concretely can limit the maximum size of the strings collected as request parameters, attributes and headers, as well as session attributes collected.. The following definition will, for example, limit all the strings collected by the sensor to 500 characters:

String length option configuration
method-sensor-type http info.novatec.inspectit.agent.sensor.method.http.HttpSensor MAX stringLength=500

You can read more about string length limitations on Sensor type definition page.

https://jira.novatec-gmbh.de/browse/INSPECTIT-439