question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Configuration parsing issue with UDS (DD_AGENT_HOST+DD_TRACE_AGENT_URL)

See original GitHub issue

Describe the bug The tracing using UDS doesn’t work when DD_AGENT_HOST and DD_TRACE_AGENT_URL is configured. Then there won’t be any traces submitted and the logfile logs:

2022-02-11 12:56:48.626 +00:00 [ERR] An error occurred while sending 1 traces to the agent at unix:///v0.4/traces System.NotSupportedException: The 'unix' scheme is not supported.
   at Datadog.Trace.ClrProfiler.CallTarget.Handlers.Continuations.TaskContinuationGenerator`4.ContinuationAction(Task`1 previousTask, TTarget target, CallTargetState state)
   at Datadog.Trace.ClrProfiler.CallTarget.Handlers.Continuations.TaskContinuationGenerator`4.ContinuationAction(Task`1 previousTask, TTarget target, CallTargetState state)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   at Datadog.Trace.Agent.Transports.HttpClientRequest.PostAsync(ArraySegment`1 bytes, String contentType)
   at Datadog.Trace.Agent.Api.SendTracesAsync(ArraySegment`1 traces, Int32 numberOfTraces, IApiRequest request, Boolean finalTry)
   at Datadog.Trace.Agent.Api.SendTracesAsync(ArraySegment`1 traces, Int32 numberOfTraces)
 { MachineName: ".", Process: "[1 dotnet]", AppDomain: "[1 ConsoleApp]", AssemblyLoadContext: "\"Default\" System.Runtime.Loader.DefaultAssemblyLoadContext #2", TracerVersion: "2.3.0.0" }

The root cause seems to be ExporterSettings.ConfigureTraceTransport, because it reads the agentHost from DD_AGENT_HOST, then checks if it starts with unix:// and sets TracesTransportType to Default. Later on the agentUri will be read from DD_TRACE_AGENT_URL. Which causes the TracesTransportStrategy to return a HttpClientRequestFactory, but the configuration is set to a UDS uri. https://github.com/DataDog/dd-trace-dotnet/blob/57f8232c2eb7837320a6ee8f2a7a4db86e37cbe2/tracer/src/Datadog.Trace/Configuration/ExporterSettings.cs#L231-L303

To Reproduce A repository with a dockerfile to reproduce can be found here: https://github.com/hiiru/dd-net-unix-issue

Basically it prepares a linux container with a .NET app and the tracer with these ENV vars set: DD_AGENT_HOST=localhost DD_TRACE_AGENT_URL unix:///var/run/datadog/apm.socket

When DD_AGENT_HOST is set, the NotSupportedException gets thrown. Otherwise the correct SocketExceptionFactory+ExtendedSocketException gets thrown (since there is no socket in the example docker).

Expected behavior I except that the TracesTransportType will be set from DD_TRACE_AGENT_URL and the tracer uses the UDS transfer. So that it’s possible to use UDS for trace and HTTP for Dogstatsd.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
pierotiboucommented, May 13, 2022

Hello @Dima-Diachenko , indeed the last release includes this fix. We’ve just released it today

2reactions
pierotiboucommented, May 10, 2022

Hello, I’ll update the ticket once this is released.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Parser returned error 0xC00CE566 Help!
I'm a idiot of System in computer == I can't find any solution to solve the question of "Configuration Parser Error"
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found