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

Trace Ids Are Occasionally Lost #5904

Open
austin-tcetra opened this issue Aug 15, 2024 · 0 comments
Open

Trace Ids Are Occasionally Lost #5904

austin-tcetra opened this issue Aug 15, 2024 · 0 comments

Comments

@austin-tcetra
Copy link

Describe the bug
When calling a WCF service, if the method signature uses Task<*>, the trace id is often lost.

To Reproduce

  1. Given the below runtime environment, our apps dropped trace ids associated with its logs.
  2. Trace Ids are not lost when the WCF method signature does NOT return a Task. (It worked when our method signature returned a string instead of Task<string>)
  3. When the method signature includes Task<string> (or any other type of task). Trace ids are generally lost. (It's not 100% of the time, we suspect a race condition).
  4. The signature or manner of the client did not change the loss of trace id. (We could await, or call in an async method, or call it as a synchronous call, etc).
  5. AfterReceiveRequest would always have a trace_id
  6. Inside the message body, we could get the trace_id from DD
  7. BeforeSendReply would not have a trace_id

Expected behavior
We expect to see a trace_id in the DD logs, as well as in the BeforeSendReply method.

Runtime environment (please complete the following information):

  • Instrumentation mode: datadog-dotnet-apm-2.47.0-x64.msi etc,
  • Tracer version: 2.47.0, 2.49.0, 2.56.0
  • OS: Windows Server 2022 Datacenter, Version 10.0.20348 Build 20348
  • CLR: .NET Framework 4.8

Additional context
We implemented a "workaround" where we stuff the trace_id into state and in our logs override the DD fields (trace_id and span_id) from state. We're assuming this is a threading issue or race condition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant