Skip to content

Fix trace agent connection issues that emerge in Azure App Service environment#852

Merged
zacharycmontoya merged 9 commits into
masterfrom
zach/fix/aas-agent-connection
Aug 28, 2020
Merged

Fix trace agent connection issues that emerge in Azure App Service environment#852
zacharycmontoya merged 9 commits into
masterfrom
zach/fix/aas-agent-connection

Conversation

@zacharycmontoya

@zacharycmontoya zacharycmontoya commented Aug 11, 2020

Copy link
Copy Markdown
Contributor
  • Fix regression from v1.18.0 when the Tracer began using WebRequest instead of HttpClient. This change caused us to miss SocketExceptions that indicated we needed to restart the trace agent, since the SocketException was nested in two exceptions instead of one. Now, we unwrap the exceptions until reaching the innermost exception to determine if we encountered the SocketException.
  • Make Api._tracesEndpoint mutable so retries can receive an updated port number, if needed.
  • Reset the ProcessMetadata.HasAttemptedStartup field when forcing a restart so consecutive failed Trace agent responses don't trigger resets that are already in-progress.
  • Immediately catch ArgumentExceptions when invoking Process.GetProcessById because we fully expect this to occur.

@DataDog/apm-dotnet

- Rewrite SocketException logic to compare against innermost exception. By checking only Exception.InnerException we have been unable to detect the SocketException's since upgrading the .NET Tracer to 1.18.0
…lly changing the endpoint so retries can take advantage of updated ports in AAS

- Modify the SubscribeToTraceAgentPortOverride callback to use this new mechanism
…start so failed Trace agent responses don't trigger concurrent resets.
@zacharycmontoya zacharycmontoya added area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) area:azure-site-extension Changes for AAS support labels Aug 11, 2020
@zacharycmontoya
zacharycmontoya requested a review from a team as a code owner August 11, 2020 20:54
@zacharycmontoya zacharycmontoya self-assigned this Aug 11, 2020
Comment thread src/Datadog.Trace/Agent/Api.cs Outdated
Comment thread src/Datadog.Trace/TracingProcessManager.cs

@lucaspimentel lucaspimentel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Left 2 non-blocking rename suggestions.

Comment thread src/Datadog.Trace/Agent/IAgentWriter.cs Outdated
Comment thread src/Datadog.Trace/Agent/IApi.cs Outdated
@zacharycmontoya
zacharycmontoya merged commit a55c7e1 into master Aug 28, 2020
@zacharycmontoya
zacharycmontoya deleted the zach/fix/aas-agent-connection branch August 28, 2020 01:03
@zacharycmontoya zacharycmontoya added this to the 1.19.2 milestone Aug 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:azure-site-extension Changes for AAS support area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants