Tip | ||
---|---|---|
| ||
The inspectIT default configuration file already integrates database sensor configurations for most databases. Changes to the database sensor configuration are rarely needed. |
...
For database tracing inspectIT provides four sensor types:
Sensortype | Class | Description |
---|---|---|
Statement Sensor | info.novatec.inspectit.agent.sensor.method.jdbc.StatementSensor | Assigned to methods of classes that perform un-prepared SQL Statements |
Connection Sensor | info.novatec.inspectit.agent.sensor.method.jdbc.ConnectionSensor | Assigned to the methods that create prepared Statements. Without the instrumenting of the Connection the concrete prepared Statements are not found by inspectIT |
Prepared Statement Sensor | info.novatec.inspectit.agent.sensor.method.jdbc.PreparedStatementSensor | Assigned to the execute methods of prepared Statements |
Prepared Statement Parameter Sensor | info.novatec.inspectit.agent.sensor.method.jdbc.PreparedStatementParameterSensor | Optional sensor that allows to trace the concrete values that a prepared statement had when it was executed. All methods that set the values in the prepared statement classes need to be assigned with this |
Example sensor type definition (not necessary to change!)
...
sensor |
...
type |
...
Prepared Statement Parameter Replacement
...
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.
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!
...
Configuration basics
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.
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.
...
This sensor enables the limitations of the string values collected. The database sensor concretely can limit the maximum size of the SQL strings collected. The following definition will, for example, limit all the strings collected by the sensor to 500 characters:
Code Block | ||
---|---|---|
| ||
method-sensor-type jdbc-prepared-statement info.novatec.inspectit.agent.sensor.method.jdbc.PreparedStatementSensor MIN stringLength=500
|
You
Configuration basics
The string length configuration for all sensors is available in the Environment configuration. You can read more about string length limitations on Sensor type definition page. Environment configuration page.
Info |
---|
From version 1.5 the default string length limit for the database sensor is set to 1000 characters. |