Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Transaction created by the HttpClient is not appended as a child to the current Transaction #2408

Open
cosmin19 opened this issue Aug 7, 2024 · 0 comments
Labels
bug Something isn't working community triage

Comments

@cosmin19
Copy link

cosmin19 commented Aug 7, 2024

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:

  1. Create a new ASP.NET Web Api application in Visual Studio
  2. Create 3 services, FirstService.cs, SecondService.cs, ThirdService.cs with a dummy method in each
  3. In the controller endpoint created automatically, call FirstService's method passing Agent.Tracer.CurrentTransaction as a parameter
  4. 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
  5. 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
  6. 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

@cosmin19 cosmin19 added the bug Something isn't working label Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working community triage
Projects
None yet
Development

No branches or pull requests

1 participant