-
Notifications
You must be signed in to change notification settings - Fork 5k
Log details of app being launched by dotnet(.exe) to ETW/LTTng #3156
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Would like this to be considered for next minor release, or even better, a servicing release 😄 |
CoreCLR has the concept of the RuntimeInformation event which does a stripped-down version of this for things that the runtime knows, and it is quite valuable. This is what is logged in the RuntimeInformation event:
It can be quite useful and I can imagine that the information requested here would also be quite valuable. One thing to note is that amost all of the information requested here is information that the host has but the runtime does not. This complicates things just a bit because the component that knows how to log to the platform-dependent and platform-independent loggers is the runtime. I would recommend designing a mechanism to pass this information from the host to the runtime and let the runtime log it. This will guarantee that the information is exposed in all the right logging mechanisms on each platform (both platform-independent and platform-dependent). I can help with details on exactly what to do here. |
Sounds great. Where is the RuntimeInformation event logged today? |
It's logged in a few places:
The code that does the actual logging is here: https://github.com/dotnet/coreclr/blob/86f418f0bd196ba84ab702410500271a4f8b0c33/src/vm/eventtrace.cpp#L4926. It is called from a few different places. |
Oh yes, I want this for security scanning, including fingerprinting of assemblies (SHA and signer would be great) loaded during startup, and even better, runtime, for dynamic loaded. |
Curious where this has landed? Are we getting this for 3.0? |
We are still gathering details on what should be logged. We should put this on the potential list for .NET Core 3.1 |
ping ? |
It is on our backlog. @DamianEdwards are you the right person to get the specifics on what is needed? We explored this in late .NET Core 3, but the requirements were not solid enough for us to build something. |
@vitek-karas, @shirhatti, and @noahfalk talked about this issue. Here are some notes.
Here is the work we agreed to perform in 3.1:
This will be achieved by:
|
Based on recent offline discussion with @blowdart the security scanning aspect is a somewhat different ask. In addition it might already be sort of "resolved" by existing assembly loader tracing. |
For the work agreed upon here, I'm in the process of making the following changes:
A sample output of the event is here:
@shirhatti can you please verify if the output is what'd you'd like to have? |
@noahfalk recommended structuring the schema for some items (like TPA, FX_RESOLUTION) as arrays of structured items, rather than strings. I'll update it. |
I would change the name of the property in |
I discussed the logging format issue with @shirhatti, who preferred publishing the runtime properties as simple strings (that are also human readable) rather than binary blobs. So, we'll try implementing the event with data-definitions as individual strings, as described above |
As part of dotnet/core-setup#4112, this change adds the RuntimeProperties event. This event during fired on startup, and publishes all properties passed by the host to the runtime. Known properties are explicitly called out by the event template. Other properties are accumulated into the "Others" string. Currently, due to EventPipe’s attach only nature, a test using event-pipe may miss the event. So, this change doesn't include an automated test. The recommended method for testing the event was using ETW. I'll send out a PR to the PerfView repo to add this event to TraceEvent.
@vitek-karas @swaroop-sridhar I'm thinking that this is a 6.0 item now, any objections? |
agreed 😢 |
Me too. |
In order to make the event extensible, we'd agreed that the event's payload will contain two arrays -- for property names and values -- similar to what's passed in to the runtime. Initially, we only report the following properties: |
@swaroop-sridhar do you have a plan for how this data will ultimately get logged? If it gets logged from the runtime, or managed code, we have the ability to use the runtime support for tracing. Is the idea here to extend the interface between the host and the runtime to pass this data, and then the runtime is responsible for logging it? |
Sounds good. Thanks much @swaroop-sridhar. |
I believe this work has been completed in #690 |
#690 was never merged - as far as I know this functionality doesn't exist in the runtime yet. The only even which is there is Runtime Start - which logs version of CoreCLR and BCL, but nothing else. |
There is a desire in certain environments to get details about .NET Core apps being launched in order to aid in analysis of issues, distribution of frameworks and dependencies being loaded, etc. (similar to the way that .NET apps log to the Windows Event log when they crash to capture details of failure). This can be particularly useful to discover how many apps are using a given shared framework version (to aid in planning to uninstall that version), or which apps are using a particular dependency (in case there is a security or compliance issue of some kind).
To this end, the host layer should log details about the app being launched to the appropriate sink for the OS (e.g. ETW on Windows, LTTng on Linux). The following details would be helpful:
It might be good to enable configuring which of these details is logged, e.g. via ETW event names or keywords.
The text was updated successfully, but these errors were encountered: