Add Linux support
pharring opened this issue ยท 23 comments
Please vote or add comments regarding support for Application Insights Snapshot Debugger for .NET Core application on Linux.
If you comment, it would help if you could describe the environment (e.g. in a Linux VM; in a docker container; in Kubernetes; in Azure App Service for Linux).
Hello, I am voting in favor of Linux on Kubernet. Thank you.
+1
Using AKS
Reiterating my original support for this, we're now in full swing migration to AKS and have had to add conditional logic to completely disable the snapshot collector in non-windows environments.
+1 kubernetes
Kubernetes. Thank you!
+1 Azure App service for containers (and AKS in the future)
๐๐พ support for Kubernetes!
Could we get any information on when this will be supported? Specifically for AKS. Thanks.
+1 support for AKS/Linux
@pharring spent some time digging on this a little today. Why is SnapshotUploader(and 64) unmanaged? That seems like the biggest gatekeeper to letting the community chip in here (in addition to the code being technically closed source in general it seems). I was able to decompile and refactor the latest codebase, get it running in a linux docker container, and produce (I think) a valid dump in a few hours. It's not production grade, but wanted to understand the roadblocks better. Then I realized the uploader being unmanaged and using non-trivial message transports meant I coulnd't really go any further on my own.
Thanks for the interest. I love the enthusiasm, @tghamm. I will be as honest and open with you as I can be.
Linux support (along with containers) has been on our backlog for a long time. Unfortunately, since it's such a big work item, it keeps getting pushed down the priority stack by other things. We had a prototype going a few years ago -- thanks to the work of an incredible intern -- but we weren't funded to take it to production. Since then, I've raised the request several times and each time there has been diminishing enthusiasm from the business side. Snapshot Debugger adoption has not been as high as we expected or wanted.
Some technical pointers:
SnapshotUploader is not actually unmanaged. However, it is heavily tied to Windows via P/Invokes (PssSnapshot APIs, DIASymReader, MinidumpWriteDump and EXCEPTION_CONTEXT) and it is a .NET Framework application, not .NET Core.
The communication between SnapshotCollector and SnapshotUploader is via a named pipe. SnapshotUploader is the server-side so that it can keep going if the client (your app) crashes. The protocol is binary. The first 4 bytes specify the message type (version). There are only 3 kinds of message: Snapshot request, Shutdown request and PDB scan request. The most complex is the Snapshot request (pointer-size, exception-pointers, PSS Snapshot information and metadata-as-JSON).
There's more to it than the uploader, though:
- How to snapshot the process. It'll be some variant of fork. (Presumably you figured that part out already).
- How to capture exception information.
- How to serialize the snapshot process and exception information in a way that the uploader can create a durable crash dump.
- Decide on a crash-dump format. Something natively-Linux-y or something compatible with dotnet-dump
On the service side, we need to recognize and handle the Linux crash-dump format and update our analyzer to work with it.
+1 kubernetes
+1 Azure App service for containers (and AKS in the future)
We're using ServiceFabric on Linux, and would love to be able to capture snapshots and view them in App Insights. I don't think there's anything ServiceFabric specific here, just being able to capture snapshots for an ASP.NET Core 6+ app running on Ubuntu 20 would suffice.
Thank you @pharring for the transparency on the issues, it's always refreshing and helpful to understand the priority and likelihood of a feature.
"diminishing enthusiasm from the business side. Snapshot Debugger adoption has not been as high as we expected or wanted."
This seems like a vicious circle; we can't adopt it because it's not available on the most valuable platform of docker/linux.
@pharring maybe explain to the business side that we would need to buy ALLOT more storage to store all those dumps in the log workspace (or wherever it gets put).
I literally just need to update images and flip a Boolean to get it to work on our ever larger growing AKS cluster.
Actually i needed to flip the boolean the other way around, because i was getting those errors when we rolled out a 8KS namespace per pull request
and most of use probably don't care about officially having support that we can contact microsoft for. we just want it to work for 99% of the time.
and don't want "weird" PLATFORM_NOT_SUPPORTED exceptions when lifting and shifting from a old windows based setup.
i'm also in the process of preparing to move our entire production setup over, but not being able to have those exception snapshots might be a big deal breaker for a bunch of companies
@pharring maybe also add sidecar container support?
that way even if my pod crashes\gets evicted because of issues, the upload should be able to continue without issues
Bump for Microsoft ever growing commitment to Kubernetes and Linux?
Maybe some(supervisor)one didn't get the memo people might need this?
Another vote here as well. Big surprise it hasn't been prioritized yet. Who deploys app services to Windows these days?
My guess is that this is on hold until after the shift towards Open Telemetry being the official SDK for Application Insights. After that point we may get a new Live Profiler and xplat Snapshot Debugger. But big features aren't fast to deploy. We will watch and wait.
@pharring Can we get a clarification if this is meaning that Snapshot Debugger will never be supported vs is not supported yet?
https://learn.microsoft.com/en-us/azure/azure-monitor/app/opentelemetry-enable?tabs=aspnetcore#whats-the-current-release-state-of-features-within-the-azure-monitor-opentelemetry-distro
Thanks for the question. With regards to that table, interpret it as "not supported yet".