Skip to content

[bug] Sql ClientInstrumentation Not Working #2646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
crash89 opened this issue Mar 6, 2025 · 0 comments
Open

[bug] Sql ClientInstrumentation Not Working #2646

crash89 opened this issue Mar 6, 2025 · 0 comments
Labels
bug Something isn't working comp:instrumentation.sqlclient Things related to OpenTelemetry.Instrumentation.SqlClient needs-triage New issues which have not been classified or triaged by a community member

Comments

@crash89
Copy link

crash89 commented Mar 6, 2025

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

@crash89 crash89 added bug Something isn't working needs-triage New issues which have not been classified or triaged by a community member labels Mar 6, 2025
@Kielek Kielek transferred this issue from open-telemetry/opentelemetry-dotnet Mar 6, 2025
@TimothyMothra TimothyMothra added the comp:instrumentation.sqlclient Things related to OpenTelemetry.Instrumentation.SqlClient label Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working comp:instrumentation.sqlclient Things related to OpenTelemetry.Instrumentation.SqlClient needs-triage New issues which have not been classified or triaged by a community member
Projects
None yet
Development

No branches or pull requests

2 participants