You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a new ASP.NET Web Api application in Visual Studio
Create 3 services, FirstService.cs, SecondService.cs, ThirdService.cs with a dummy method in each
In the controller endpoint created automatically, call FirstService's method passing Agent.Tracer.CurrentTransaction as a parameter
In the FirstService's method, create a new transaction using the transaction from the controller as parent. Then, call SecondService's method, passing the new transaction as a parameter
In the SecondService's method, create a new span using the transaction from FirstService as parent. Then, call ThirdService's method, passing the new span as a parameter
In the ThirdService's method, create a new transaction using the span from the SecondService as parent. Then, using a HttpClient, send a GET request to any website (ex. google.com)
Expected behavior
The transaction created by the APM SDK when using the HttpClient should be appended as a child of the newly created transaction in ThirdService
Actual behavior
The transaction created by the APM SDK when using the HttpClient is appended as a child of the span created in SecondService. If the SecondService creates a transaction instead of span, the transaction created by the HttpClient is appended correctly as a child of ThirdService
The text was updated successfully, but these errors were encountered:
APM Agent version
Version: 1.28.0
Environment
Operating system and version: Windows 10
.NET Framework/Core name and version : .NET 8
Application Target Framework(s): net8.0
Describe the bug
The transaction created by the APM SDK when sending a request, using HttpClient, is not appended correctly as child to the current opened transaction.
To Reproduce
I created a POC for you to reproduce this bug easier. See GitHub repo: elatic-apm-parent-segment-bug
OR
Steps to reproduce the behavior:
FirstService.cs
,SecondService.cs
,ThirdService.cs
with a dummy method in eachFirstService
's method passingAgent.Tracer.CurrentTransaction
as a parameterFirstService
's method, create a new transaction using the transaction from the controller as parent. Then, callSecondService
's method, passing the new transaction as a parameterSecondService
's method, create a new span using the transaction fromFirstService
as parent. Then, callThirdService
's method, passing the new span as a parameterThirdService
's method, create a new transaction using the span from theSecondService
as parent. Then, using a HttpClient, send a GET request to any website (ex. google.com)Expected behavior
The transaction created by the APM SDK when using the HttpClient should be appended as a child of the newly created transaction in
ThirdService
Actual behavior
The transaction created by the APM SDK when using the HttpClient is appended as a child of the span created in
SecondService
. If theSecondService
creates a transaction instead of span, the transaction created by the HttpClient is appended correctly as a child ofThirdService
The text was updated successfully, but these errors were encountered: