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

Change meta data service timeout to 200ms #2387

Merged
merged 6 commits into from
Apr 5, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,8 @@ def _get_azure_vm_metadata():
request = Request(_AZURE_VM_METADATA_ENDPOINT)
request.add_header("Metadata", "True")
try:
# TODO: Changed to 4s to fit into OTel SDK's 5 second timeout.
# Lengthen or allow user input if issue is resolved.
# See https://github.com/open-telemetry/opentelemetry-python/issues/3644
with urlopen(request, timeout=4) as response:
# VM metadata service should not take more than 200ms on success case
with urlopen(request, timeout=0.2) as response:
return loads(response.read())
except URLError:
# Not on Azure VM
lzchen marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
Loading