Open jiwen624 opened 2 years ago
Thanks @jiwen624 for creating a bug for this. When i last tested with hibernate, it seemed the execution of prepared statements were not instrumented. I can reverify it again.
But anyway, this is a bug. Will assign it to myself for now.
Hello there,
I'm looking into the code of
io.opentelemetry.sqlcommenter.schibernate.SCHibernate
where the current trace context is injected as a comment into a SQL statement which will be prepared later. However, as aPreparedStatement
object it is normally prepared once but executed many times with different parameter values and this may be a problem.Let's imagine a scenario where a web application is serving client requests and the injected statement is prepared and stored somewhere in a thread and reused by multiple client requests. When the subsequent client requests are handled, the same trace context is reused again and again because the same prepared statement is executed. I guess this would lead to an incorrect correlation?
Thanks.