mirror of
https://github.com/open-telemetry/opentelemetry-python-contrib.git
synced 2025-07-29 21:23:55 +08:00
Change meta data service timeout to 200ms (#2387)
This commit is contained in:
15
resource/opentelemetry-resource-detector-azure/CHANGELOG.md
Normal file
15
resource/opentelemetry-resource-detector-azure/CHANGELOG.md
Normal file
@ -0,0 +1,15 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## Unreleased
|
||||
|
||||
- Change meta data service timeout to 200ms
|
||||
([#2387](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2387))
|
||||
|
||||
## Version 0.1.2 (2024-01-25)
|
||||
|
||||
- Initial CHANGELOG.md entry
|
@ -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
|
||||
|
Reference in New Issue
Block a user