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

transport/http: fix metrics race condition #555

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rjeczalik
Copy link

This PR fixes a race condition reported by #548,
by introducing a simple wrapper for time.Time.

While by default aws-sdk-go-v2 uses NopMeterProvider, the transport/http internals are still instrumenting the http requests (the withMetrics func).

Maybe there is a room for improvement, to not call httptrace.WithClientTrace when the meter is nop,
however this is out of scope for this PR.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

This PR fixes a race condition reported by aws#548,
by introducing a simple wrapper for time.Time.

While by default aws-sdk-go-v2 uses NopMeterProvider,
the transport/http internals are still instrumenting
the http requests (the withMetrics func).

Maybe there is a room for improvement, to not call
httptrace.WithClientTrace when the meter is nop,
however this is out of scope for this PR.
@rjeczalik rjeczalik requested review from a team as code owners December 9, 2024 08:36
@rjeczalik
Copy link
Author

fyi @lucix-aws @Madrigal

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

Successfully merging this pull request may close these issues.

1 participant