One of the amazing things about .NET Core is that it runs almost everywhere! This versatility comes with a challenge you also may need to diagnose issues in a variety of scenarios. I think it would be true to say that our ability to diagnose issues on non Windows platforms have left noticeable gaps in tooling.
I have been really fortunate to partner with .NET team to help develop dotnet-monitor, it is designed to makes it easier to egress diagnostics information from a .NET process regardless of the OS or even if it sits in container.
dotnet-monitor is built on an open diagnostics technology call Microsoft.Diagnostics.NETCore.Client (also known as the Diagnostics Client library). This managed library lets you interact with .NET Core runtime (CoreCLR) for various diagnostics related tasks, such as tracing, requesting a dump, or attaching an ICorProfiler. Using this library, you could, quite frankly, write your own diagnostics tools customized for your particular scenario.
We have exposed an API surface that covers tracing, metrics, logs, GC dumps and core dumps as follows:
This product is currently a preview tool that can be installed locally (dotnet tool install -g dotnet-monitor) or as container image.
What I love about this moment is that more of our tools are maturing to not only capture diagnostics artifacts anywhere, but also consume and use them regardless of where it was created. For example the traces and GC Dumps captured on Linux can be consumed directly in Visual Studio.
To further this cross platform goal starting with Visual Studio 16.8 preview 3 you will be open managed Linux Core Dumps and debug them directly! For those familiar with opening Windows Dumps in Visual Studio you land on the Dump Summary page, where you can start debugging and diagnosing issues with all the first class tools available in Visual Studio. All this goodness is possible because the .NET team prioritized adding support for cross building Linux DAC to run on Windows.
If you are interested in our progress please keep up with the dotnet-monitor project here!