Open ahoka opened 7 years ago
Hi,
I'm sorry for the delay, I was out of the office for several days. Could you please share how you configure your application to use correlation?
Correlation provides 3 parts: parsing context from the incoming request, injecting it to outgoing request and retaining it for the request life-cycle. And probably the problem is that first part is missing: nothing handles incoming requests and creates context. In this case there is nothing to inject to outgoing header.
In non-ASP.NET case, we expect that context will be set by user code. You may create CorrelationContext
and set it with ContextResolver
.
I think correlation should throw more meaningful exception if no context is set, to indicate that it's not supported.
In your case, why would you want to use correlation without incoming requests handling?
Hi,
I have the following code in ASP's Configure method:
var configuration = new AspNetCoreCorrelationConfiguration();
ContextTracingInstrumentation.Enable(configuration);
I think the problem here is that not all outgoing requests come from an incoming request. In my case I would like to register my micro-service during application startup over HTTP.
I think Diagnostics.Correlation should just quietly ignore the HttpClient in these cases, because this way it breaks 3rd party clients used in my application.
Hi,
I have a problem where I want to use a library which calls HttpClient.SendAsync outside of ASP, but after registering Microsoft.Diagnostics.Correlation to the application server. The problem seems to be that there is no CorrelationContext in that situation:
I think that it should just silently ignore it in this case.