Support for SQL bind variables

Due to high network and storage demands, support for bind variables isn't available for Dynatrace SaaS.

Bind variables are a means to parameterize SQL statements and result in statements that have question marks or parameters in their where clauses, such as:

  • SQL server: select count (*) from report where tenant = @tenant
  • Java JDBC: select count (*) from report where tenant = ?

Bind variables allow the database server to prepare the statement once and execute it multiple times without reparsing or reanalyzing it.

Note: Bind variables aren't applicable to statements that use literals, such as: select count (*) from report where tenant = ‘xxxx’.

These statements can't be parameterized and are reparsed and reanalyzed by the database server at each execution.

Note: This feature can capture a lot of sensitive data, which is why it's available only within Dynatrace Managed environments. Because it can generate high network traffic and storage demands, it's recommended to use it with caution and only for specific process groups.

To enable SQL bind value capture:

  1. From the Cluster Management Console navigation menu, click Settings > Server-side service monitoring > Deep monitoring.

  2. Under Database, enable the Capture SQL bind values setting. capture sql bind values

Whether you enable this setting site-wide or for individual process groups, you can use Dynatrace OneAgent to capture the values of bind parameters. This is applicable to the following technologies:

  • ADO.net
  • JDBC
  • PHP database frameworks

A sample result of this feature is PurePaths. The following web page illustrates the masking of bind variables.

purepath example

Bind variables are considered confidential as they can contain IDs and other sensitive values. Learn how to ensure the data privacy of your customers.

Only users who have the permissions for a specific entity or management zone can view the bind variables within that entity or zone.

purepath example for authorized users