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
It works by creating a tracing wrapping over the driver. In order to do this, you have to initialize a Driver and register it in the datadog package.
sqltrace.Register(driverName, &mssql.Driver{})
The issue i'm having is that statements with variables stopped working:
Incorrect syntax near '?'."
I know "?" for placeholder is not mssql standard but it used to work before tracing. After some digging I found that defining processQueryText as true correctly fixes this issue.
As I cannot change every statement in the codebase, I am enabling tracing with the help of reflection:
driver := &mssql.Driver{}
dv := reflect.ValueOf(driver).Elem().FieldByName("processQueryText")
dv = reflect.NewAt(dv.Type(), unsafe.Pointer(dv.UnsafeAddr())).Elem()
if dv.IsValid() && dv.CanSet() {
dv.SetBool(true)
}
sqltrace.Register("mssql", driver)
Maybe it makes sense to expose the driver instances?
The text was updated successfully, but these errors were encountered:
I'm enabling dd-trace-go over "mssql" driver.
It works by creating a tracing wrapping over the driver. In order to do this, you have to initialize a Driver and register it in the datadog package.
sqltrace.Register(driverName, &mssql.Driver{})
The issue i'm having is that statements with variables stopped working:
Incorrect syntax near '?'."
I know "?" for placeholder is not mssql standard but it used to work before tracing. After some digging I found that defining processQueryText as true correctly fixes this issue.
As I cannot change every statement in the codebase, I am enabling tracing with the help of reflection:
Maybe it makes sense to expose the driver instances?
The text was updated successfully, but these errors were encountered: