You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, SQL queries displayed on the Transaction Trace SQL queries tab are not. More specifically, they are truncated only if the statement is an insert:
We would expect that SQL queries would be treated the same way throughout the product. If they are not, the intuitive location to display the complete, untruncated SQL query is the Datastores slow query page.
In internal discussions, we identified the following discrepancies:
SQL statements for Transaction Segments are truncated only if the statement is an INSERT. When they are truncated, they obey the insert_sql_max_length setting.
SQL statements for Slow Query SQL Traces are always truncated. They obey the insert_sql_max_length setting.
SQL statements for Span Events (captured as db.statement) are always truncated. They are hardcoded to truncate either to 4095 chars for agents >= 8.12 or to 2000 chars for agents < 8.12. They do not obey the insert_sql_max_length setting.
It also appears that not all of our APM agents limit SQL query size in the same way. Additional work is needed to determine if this is consistent with agent specification.
The text was updated successfully, but these errors were encountered:
Description
SQL queries displayed on the Datastores page in APM are truncated at 2,000 characters by default, as per
https://docs.newrelic.com/docs/apm/agents/java-agent/configuration/java-agent-configuration-config-file/#insert_sql_max_length
However, SQL queries displayed on the Transaction Trace SQL queries tab are not. More specifically, they are truncated only if the statement is an insert:
newrelic-java-agent/newrelic-agent/src/main/java/com/newrelic/agent/trace/TransactionSegment.java
Line 255 in 0708427
Expected Behavior
We would expect that SQL queries would be treated the same way throughout the product. If they are not, the intuitive location to display the complete, untruncated SQL query is the Datastores slow query page.
Troubleshooting or [NR Diag]
In internal discussions, we identified the following discrepancies:
SQL statements for Transaction Segments are truncated only if the statement is an INSERT. When they are truncated, they obey the insert_sql_max_length setting.
SQL statements for Slow Query SQL Traces are always truncated. They obey the insert_sql_max_length setting.
SQL statements for Span Events (captured as db.statement) are always truncated. They are hardcoded to truncate either to 4095 chars for agents >= 8.12 or to 2000 chars for agents < 8.12. They do not obey the insert_sql_max_length setting.
It also appears that not all of our APM agents limit SQL query size in the same way. Additional work is needed to determine if this is consistent with agent specification.
The text was updated successfully, but these errors were encountered: