Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discrepancy in how SQL queries are captured / truncated in different areas of APM #2079

Open
JesseLaughlin opened this issue Sep 30, 2024 · 2 comments
Labels
feature request Suggestion for a new product enhancement or change

Comments

@JesseLaughlin
Copy link

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:

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.

@JesseLaughlin JesseLaughlin added the bug Something isn't working as designed/intended label Sep 30, 2024
@workato-integration
Copy link

@kford-newrelic
Copy link
Contributor

Suggested enhancement will be evaluated but this is not a bug.

@kford-newrelic kford-newrelic added feature request Suggestion for a new product enhancement or change and removed bug Something isn't working as designed/intended labels Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Suggestion for a new product enhancement or change
Projects
None yet
Development

No branches or pull requests

2 participants