This is likely a problem in the Java Agent as well...
The OpenTelemetry Ruby SQL obfuscation and statement extraction code was largely a copy-paste project from the New Relic Ruby agent. While refactoring that code in open-telemetry/opentelemetry-ruby-contrib#529, we discovered statement extraction and SQL obfuscation needed some tweaking when sqlcommenter was used.
I verified our existing SQL obfuscation code properly handles prepended SQLCommenter comments. Manually copied the new cross agent test cases into the SQLObfuscator test and all passed.
This is likely a problem in the Java Agent as well...
The OpenTelemetry Ruby SQL obfuscation and statement extraction code was largely a copy-paste project from the New Relic Ruby agent. While refactoring that code in open-telemetry/opentelemetry-ruby-contrib#529, we discovered statement extraction and SQL obfuscation needed some tweaking when sqlcommenter was used.
Commit where edge case was discussed: https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/529/commits/b8b2605d3cc321865a5356f66cc1bb696ca92af4 (look at resolved discussions) Commit with fix: https://github.com/open-telemetry/opentelemetry-ruby-contrib/commit/82584bae3c9132846fdd593a124dc680b770af28 This PR adds test cases to the cross-agent tests to cover sqlcommenter.
Source: https://source.datanerd.us/agents/cross_agent_tests/pull/155