Skip to content

[bug] Sql ClientInstrumentation Not Working #2646

Open
@crash89

Description

@crash89

Package

OpenTelemetry

Package Version

Package Name Version
OpenTelemetry.Api 1.11.2
OpenTelemetry 1.11.2
TBD TBD

Runtime Version

1.11.0-beta-2

Description

"Hello, I am using OpenTelemetry with the ASP.Net 4.6 framework. Everything is working fine, but when I try to log SQL, I noticed that neither Enrich nor SetDbStatementForText is working. Am I doing something wrong somewhere?"

Steps to Reproduce

    builderTrace.AddSqlClientInstrumentation(Sub(opt)
                                                 opt.Filter = Function(rawObj)
                                                                  If 1 = 1 Then

                                                                  End If
                                                                  Return True
                                                              End Function

                                                 opt.SetDbStatementForText = True
                                                 opt.RecordException = True
                                                 opt.Enrich = Function(activity, command, rawObject)
                                                                  If 1 = 1 Then

                                                                  End If
                                                              End Function

Expected Result

    builderTrace.AddSqlClientInstrumentation(Sub(opt)
                                                 opt.Filter = Function(rawObj)
                                                                  If 1 = 1 Then

                                                                  End If
                                                                  Return True
                                                              End Function

                                                 opt.SetDbStatementForText = True
                                                 opt.RecordException = True
                                                 opt.Enrich = Function(activity, command, rawObject)
                                                                  If 1 = 1 Then

                                                                  End If
                                                              End Function

Actual Result

    builderTrace.AddSqlClientInstrumentation(Sub(opt)
                                                 opt.Filter = Function(rawObj)
                                                                  If 1 = 1 Then

                                                                  End If
                                                                  Return True
                                                              End Function

                                                 opt.SetDbStatementForText = True
                                                 opt.RecordException = True
                                                 opt.Enrich = Function(activity, command, rawObject)
                                                                  If 1 = 1 Then

                                                                  End If
                                                              End Function

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcomp:instrumentation.sqlclientThings related to OpenTelemetry.Instrumentation.SqlClientneeds-triageNew issues which have not been classified or triaged by a community member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions