-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Resource error #33253
Comments
Investigating. @harmankaya I have not been able to reproduce this. Are you seeing this locally or on a non-VM Azure Resource? |
I am seeing this on my local machine and a non-VM Azure resource. I tried downgrading back to 1.0.0 but still got the same issue. |
Referencing issue here with steps to reproduce it. |
@harmankaya What app frameworks are you using? Ex: flask, django, fastapi, uvicorn, gunicorn...etc |
Sorry, the company I work for uses FastAPI with uvicorn, more details here: #33295 . |
We have release azure-monitor-opentelemetry=1.1.1 . This includes the ability to disable resource detectors. For instance, in order to disable the VM detector, but leave the App Service detector on, the customer can set their environment variable OTEL_EXPERIMENTAL_RESOURCE_DETECTORS="azure_app_service" Let me know if this solves the problem. |
@harmankaya Please try with the latest version of opentelemetry-resource-detector-azure==0.1.1 |
Hi! I just tried it with version 1.1.1 and OTEL_EXPERIMENTAL_RESOURCE_DETECTORS="azure_app_service", it seems to work now. I have not yet looked deeply into the code, but I am using fastapi in a non-Azure resource, in a docker container, and how does setting OTEL_EXPERIMENTAL_RESOURCE_DETECTORS="azure_app_service" affect the application? Is there a way to set OTEL_EXPERIMENTAL_RESOURCE_DETECTORS to none/empty? |
@harmankaya To summarize:
|
I believe I have discovered the source of the confusing warning: The concurrent.futures system that the OpenTelemetry SDK is using to run the resource detectors is not working correctly for processes that can take longer than 5 seconds. I have made an issue in the OTel repo to track this. |
The issue stems from an unclear timeout in the OTel SDK. My fix will be in the next release. In order to not trigger the 5 second timeout, the VM Resource Detector now sets its own timeout to 4s. Please update to opentelemetry-resource-detector-azure=0.1.3 |
Migrated from old repo issue
Is it possible to make
_setup_resources()
optional inconfigure_azure_monitor()
? I'm referring to the following segment of code:When developing a containerized FastAPI application, I encounter an issue during live reloads or application startups. The error message is as follows:
This error repeats multiple times with a few seconds interval, ultimately leading to:
After these messages, the application starts normally. However, this issue is a significant inconvenience during local development, particularly when experimenting with Azure Application Insights.
I suspect _setup_resources() is the root cause, as it seems to configure the environment as if it were an Azure resource. Could this be the case?
Additionally, I've only started encountering this error in version 1.1.0; it wasn't an issue in previous versions.
Lastly, why doesn't this repository reflect the latest version of the package?
The text was updated successfully, but these errors were encountered: