Closed OlegUfaev closed 3 months ago
Thanks for reporting this @OlegUfaev, this sounds like a nasty issue. This didn't make the cutoff for the several bug fix releases we did this week but I put this at the top of my queue on Monday.
Opened https://github.com/elastic/apm-agent-dotnet/pull/2427 to address this.
APM Agent version
Elastic.Apm.AspNetCore v1.28.0
Environment
Operating system and version: Windows 10
.NET Framework/Core name and version (e.g. .NET 4.6.2, NET Core 3.1.100) : .NET 8
Application Target Framework(s) (e.g. net462, netcoreapp3.1): .net8.0
Describe the bug
If an ASP.NET Core application processes a HTTP request with distributed tracing headers (
traceparent
andbaggage
) AND an exception occurs in the controller, then theElastic.Apm
logger writes the following log entry.To Reproduce
Steps to reproduce the behavior:
WebApiExample
baggage
header, and in thetraceparent
header the field with the sampled flag should be00
.Expected behavior
The System.NullReferenceException error does not occur.
Actual behavior
System.NullReferenceException error occurs.
The problem occurs in this method: Error.cs