Closed Sam13 closed 3 months ago
Could you share the name and version of the SQLClient package? there were some versions which broke telemetry, so its possible that in your prod version is different?
Hello @cijothomas
Thanks for your reply. I'm using Microsoft.Data.SqlClient version 3.0.1.
Meanwhile I found some more details by creating a custom build of SQL instrumentation with some logging. I turns out that the activity is never stopped. The handler always returns because activity source cannot be matched: https://github.com/open-telemetry/opentelemetry-dotnet/blob/f8a1f3caa43f15e4ff1bb747cea972ebd029f9dd/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlClientDiagnosticListener.cs#L145
I dumped the activity source name: Sometimes it's from another instrumentation (e.g. ASP.NET core) sometimes it's empty...
An upgrade to Microsoft.Data.SqlClient version 4.1.0 did not resolve the issue. Still no SQL tracing
This definitely does work now. If this is still an issue, please reopen the issue.
Question
I have instrumented an ASP.NET core microservice with OpenTelemetry (ASP.NET core, HTTP client, SQL client instrumentations). Everything works well except that SQL client instrumentation does not deliver any tracing data (other instrumentations do). This only happens if I deploy the service into a K8s cluster, I cannot reproduce it locally with the same Docker image.
For basic troubleshooting I instrumented my microservice as described here: https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry#troubleshooting - log level: LogAlways
The log I get is the following:
When I do the same in a local environment I get the following:
In short: Logs about
OpenTelemetry.SqlClient.Execute
are missing when running non locally but SQL query is executed (data is reported back).In addition to that I printed out the diagnostic listener event names. They match the names defined in https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry.Instrumentation.SqlClient. This means those events are fired...
Question: How can I get more information about what might be failing in SQL client instrumentation?
Describe your environment.