-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
When I bumped azure-monitor-opentelemetry-exporter from 1.0.0b36 to 1.0.0b48 in my app, it failed to start. I am running a debian docker container in Azure App Service. With Supervisor and uwsgi. Here is parts of the stack trace:
...
File "/usr/src/app/.venv/lib/python3.13/site-packages/azure/monitor/opentelemetry/exporter/_performance_counters/init.py", line 4, in
from azure.monitor.opentelemetry.exporter._performance_counters._manager import (
enable_performance_counters,
)
File "/usr/src/app/.venv/lib/python3.13/site-packages/azure/monitor/opentelemetry/exporter/_performance_counters/_manager.py", line 52, in
_io_counters_initial = _PROCESS.io_counters()
File "/usr/src/app/.venv/lib/python3.13/site-packages/psutil/init.py", line 830, in io_counters
return self._proc.io_counters()
File "/usr/src/app/.venv/lib/python3.13/site-packages/psutil/_pslinux.py", line 1718, in wrapper
raise AccessDenied(self.pid, self._name)
psutil.AccessDenied: (pid=41)
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
--- no python application found, check your startup logs for errors ---
Added lazy loading, so it won't do this on import, and more robust handling for when psutil don't have the required access.