Open christopher-taormina-zocdoc opened 4 years ago
@christopher-taormina-zocdoc , I debugged the application and yes, if you don't pass in the header X-B3-TraceId
OR X-B3-SpanId
, we will generate a Default value, so TraceId and SpanId will be zero.
@cijothomas , is that expected?
Describe your environment. Describe any aspect of your environment relevant to the problem:
I've set up the aspnetcore instrumentation on netcoreapp2.1 with the following in Startup.cs
While testing a request I noticed that the activity was given a SpanId of
0000000000000000
and TraceId of00000000000000000000000000000000
. It seems like when theHttpInListener
detects a Request assembly with a major version < 3, theTextFormat
option is used to pull the trace id's out from the http request headers and create a new ActivityContext. However, if these are not set in the request we end up with default id's of all 0's.This seems to be caused by this line in the B3Format Extract function that returns RemoteInvalidContext.
I would expect these id's to be generated when not set on the HttpRequest, denoting a call made to an edge service and starting a new Trace.
Steps to reproduce. Setup an aspnetcore 2.1 server with the following in Startup.cs
Make an httpRequest to the server without the
X-B3-TraceId
andX-B3-SpanId
headers sent.See trace sent to zipkin with default SpanId and TraceId
What is the expected behavior? New TraceId and SpanId generated by the sdk.
What is the actual behavior? Default ids