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

Fix using version 3.7.100 of AWS SDK causing exception not finding EndpointResolver #726

Merged
merged 3 commits into from
Oct 25, 2022

Conversation

normj
Copy link
Contributor

@normj normj commented Oct 21, 2022

Changes

Starting with version 3.7.100 of the AWS .NET SDK the EndpointResolver is replaced with a service specific version of the handler. This breaks the OpenTelemetry integration because OpenTelemetry was inserting itself just after EndpointResolver in the SDK's request pipeline.

The fix is for OpenTelemetry to inject itself before the RetryHandler which happens after endpoint resolutions. So the position will be the same in the request pipeline.

This fix will is compatible with both version 3.7.100 and versions before 3.7.100 so it will not break users that haven't upgrade their SDK version.

This change is very similar to the AWS X-Ray change which this code is based off: aws/aws-xray-sdk-dotnet#268

For significant contributions please make sure you have completed the following items:

  • Appropriate CHANGELOG.md updated for non-trivial changes
  • Design discussion issue #

@normj normj requested a review from a team October 21, 2022 21:18
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 21, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: normj / name: Norm Johanson (bb05050)

@@ -44,6 +44,6 @@ public void Customize(Type serviceClientType, RuntimePipeline pipeline)
return;
}

pipeline.AddHandlerAfter<EndpointResolver>(new AWSTracingPipelineHandler(this.options));
pipeline.AddHandlerAfter<RetryHandler>(new AWSTracingPipelineHandler(this.options));

Choose a reason for hiding this comment

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

"The fix is for OpenTelemetry to inject itself before the RetryHandler"

But this is injecting AFTER. Which is correct? The summary or the code in this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, good catch.

@utpilla
Copy link
Contributor

utpilla commented Oct 21, 2022

@normj Thanks for sending this PR! Could you please sign the CLA?


## 1.0.2

* Fixed issue when using version 3.7.100 of the AWS SDK for .NET triggering an EndpointResolver not found exception.
Copy link

@klementi klementi Oct 21, 2022

Choose a reason for hiding this comment

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

Where is corresponding AssemblyVersion change?

@normj
Copy link
Contributor Author

normj commented Oct 21, 2022

@normj Thanks for sending this PR! Could you please sign the CLA?

Thanks and done

@utpilla utpilla added the comp:instrumentation.aws Things related to OpenTelemetry.Instrumentation.AWS label Oct 21, 2022
@@ -1,5 +1,12 @@
# Changelog - OpenTelemetry.Contrib.Instrumentation.AWS

## 1.0.2

Released 2022-Oct-21
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't yet know when this will be released. Let's just put this change under an Unreleased heading.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

…EndpointResolver in AWS SDK instrumentation package
@codecov
Copy link

codecov bot commented Oct 21, 2022

Codecov Report

Merging #726 (17e4464) into main (1fbdddb) will not change coverage.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #726   +/-   ##
=======================================
  Coverage   77.55%   77.55%           
=======================================
  Files         176      176           
  Lines        5298     5298           
=======================================
  Hits         4109     4109           
  Misses       1189     1189           
Impacted Files Coverage Δ
...elemetry.Instrumentation.Runtime/RuntimeMetrics.cs 85.10% <ø> (ø)
...AWS/Implementation/AWSTracingPipelineCustomizer.cs 87.50% <100.00%> (ø)

normj and others added 2 commits October 25, 2022 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:instrumentation.aws Things related to OpenTelemetry.Instrumentation.AWS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants