opentracing-contrib / csharp-netcore

OpenTracing instrumentation for .NET Core 3.1 & .NET 6+ apps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enabling EF and/or CoreFx support resulting in lost spans

recfab opened this issue · comments

Hi,

I'm trying to instrument our services with Jaeger and OpenTracing (using the ConstSampler during development).

Explicit tracing seems to work fine, as do .AddAspNetCore() and .AddLoggingProvider.

However, when I enable .AddCoreFx() or .AddEntityFrameworkCore(), I see a bunch of either <trace-without-root-span> or "Invalid parent spanID" in the span logs in the Jaeger UI, or just traces don't show up at all.

Also, if I set the LogLevel to "Trace", there are a bunch of messages of the form "Can not extract value for argument type '{Type}'. Using ToString()", seemingly all of which were related to EntityFrameworkCore. I still see these messages if just .AddCoreFx() is used. No idea if those are related but it seemed worth mentioning.

The samples in your repo run fine, and I can't figure out what's different. I tried commenting out a bunch of stuff in my service's Startup.cs trying to get it to work.

Maybe the database? In the service I'm working on now, we're using Postgres with the Npgsql EFCore drivers, and NetTopologySuite for Postgis support. When I worked on this previously, I ran into the same problem in all our services, one of which uses Mongo as the data store, not Postgres, so even though .AddEntityFrameworkCore() was used, there shouldn't have been any Diagnostic events coming from EF.

I've been banging my head against this for a couple of days now, so I figured a bug report was in order. Please let know if you need any additional information.

Thanks

This should be fixed with the next version. See #80 for details.