newrelic-context icon indicating copy to clipboard operation
newrelic-context copied to clipboard

GORM + NR: is not possible to see the executed SQL query?

Open runa opened this issue 5 years ago • 3 comments

Hi Smacker; thanks for your work :)

We're enhancing our NR integration and we found out that it seems that is not possible to log the executed SQL query (SELECT... ) in NR; can you confirm this?

From what we understood it's a GORM limitation, right?

Thanks

runa avatar Mar 30 '20 15:03 runa

Hi @runa !

The query itself should be logged but not the values in the query as it will cause security issues by leaking sensitive information such as passwords, credit cards numbers and so on.

smacker avatar Apr 02 '20 05:04 smacker

Hi @smacker.

Did you prove it in the new versions of GORM? I ask for this statement by one of the creators. https://github.com/jinzhu/gorm/issues/1302#issuecomment-294737745

I understand that at some point it worked, but if you continue to see this issue, you will see that it has stopped working in future versions.

Thanks

filipemendespi avatar Apr 02 '20 12:04 filipemendespi

The lib runs tests on gorm v1.9.12 which is the latest available version of gorm. The issue you mentioned is from 2017, I believe the code has changed since then.

smacker avatar Apr 08 '20 07:04 smacker