Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Prepared statement parameter replacement is provided by the Prepared Statement Parameter Sensor. The default configuration file that inspectIT ships already provides the necessary settings that allow capturing of parameters of prepared statements.

Configuration using UI configuration interface

Using the UI configuration interface no configuration is required at all as method sensor types are activated automatically if a profile defines such sensor assignment. 

Configuration using configuration file(s)

To enable parameter replacement the sensor assignment of the prepared statement parameter sensor type to the predefined methods must be enabled (simply remove the comments "#" from the lines in the configuration file). To disable parameter replacement, the sensor assignment needs to be removed (or commented). Enabling and disabling is only active after a restart of the application!

Code Block
titleConfiguration using files
collapsetrue
# SQL Prepared Statement Parameter Replacement
#sensor jdbc-prepared-statement-parameter java.sql.PreparedStatement setBigDecimal(int,java.math.BigDecimal) interface=true
#sensor jdbc-prepared-statement-parameter java.sql.PreparedStatement setBoolean(int,boolean) interface=true
#sensor jdbc-prepared-statement-parameter java.sql.PreparedStatement setByte(int,byte) interface=true
#sensor jdbc-prepared-statement-parameter java.sql.PreparedStatement setDate(int,java.sql.Date) interface=true
#sensor jdbc-prepared-statement-parameter java.sql.PreparedStatement setDouble(int,double) interface=true
#sensor jdbc-prepared-statement-parameter java.sql.PreparedStatement setFloat(int,float) interface=true
#sensor jdbc-prepared-statement-parameter java.sql.PreparedStatement setInt(int,int) interface=true
#sensor jdbc-prepared-statement-parameter java.sql.PreparedStatement setLong(int,long) interface=true
#sensor jdbc-prepared-statement-parameter java.sql.PreparedStatement setShort(int,short) interface=true
#sensor jdbc-prepared-statement-parameter java.sql.PreparedStatement setString(int,java.lang.String) interface=true
#sensor jdbc-prepared-statement-parameter java.sql.PreparedStatement setTime(int,java.sql.Time) interface=true
#sensor jdbc-prepared-statement-parameter java.sql.PreparedStatement setTimestamp(int,java.sql.Timestamp) interface=true
#sensor jdbc-prepared-statement-parameter java.sql.PreparedStatement setObject(int,java.lang.Object) interface=true
#sensor jdbc-prepared-statement-parameter java.sql.PreparedStatement setArray(int,java.sql.Array) interface=true
#sensor jdbc-prepared-statement-parameter java.sql.PreparedStatement clearParameters() interface=true

...

Using the UI configuration interface no configuration is required at all as method sensor types are actived automatically if a profile defines such sensor assignment. 

Performance impact

The performance impact of activating the prepared statement parameter replacement is medium-high and should not be used for productive monitoring without testing it on an integration platform before. The reason is, that the number of instrumented methods and called methods for each prepared statement invocation is increased by one for each parameter. If the application uses prepared statements having long IN clauses it can easily happen that instead of just one quick call (the query itself) 100 or more calls are necessary to trace the statement.

...

String length

from version 1.3

...

This sensor enables the limitations of the string values collected. The database sensor concretely can limit the maximum size of the SQL strings collected.

Configuration using UI configuration interface

The string length configuration for all sensors is available in the Environment configuration.

Configuration using configuration file(s)

 The following definition will, for example, limit all the strings collected by the sensor to 500 characters:

...

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

Configuration using UI configuration interface

The string length configuration for all sensors is available in the Environment configuration. 

Info

From version 1.5 the default string length limit for the database sensor is set to 1000 characters.