Profiling process running as a different user
I have a .Net application running in am Ubuntu docker container using Azure Container Apps. I am trying to profile the application to track down memory and CPU issues, however when I run dotmemory or dottrace for more than 30 seconds or so, the additional memory and cpu requirements causes the instance to restart and I lose the profiling up to that point.
Azure profiles a debug container (https://learn.microsoft.com/en-us/azure/container-apps/container-debug-console?tabs=bash) that runs as a sidecar that I want to try and use to run profiling to see if I can get long running traces. From this container, I can see the .net process using ps aux

However, running dotmemory or dottrace attaching to that process gives the following error

The process is definately a .net process. Is there any way I can profile this process?
Please sign in to leave a comment.
Hi!
This message indicates that the process with the specified PID either doesn’t exist or doesn’t contain managed code.
This issue can occur if dotTrace/dotMemory and your application are running under different user accounts, as cross-user profiling is not supported on Linux.
Unfortunately, the only solution is to run the profiling inside the Docker container itself.
Hi
Are there any plans to support profiling like this? running from a different user accounts seems like a useful use case to allow profiling without impacting the actual application as much.
We have a related ticket in our tracker regarding cross-user profiling support.
Unfortunately, we can’t promise a fix in the near future, as our current efforts are focused on higher-priority issues.