-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable Custom Artifact Names with New Tokens #6675
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some design considerations:
- We may want to have some uniformity around token substitutions. I.e. doing $(Process.ProcessId) in one context but %p in another can be confusing.
- Having a one-off configuration for dumps works, but we'll need to consider if this should be more generic and apply to other artifacts
- Should the setting be possible to provide at an api level? Or strictly configuration.
Thank you for the thoughts!
|
This class would likely require some refactoring to support scalar string values instead of properties
I think we could do this piece wise. Start with just configuration and consider an api level override later. |
I've changed the pattern. Let me know what you think. I'm uncertain about two things:
|
src/Tools/dotnet-monitor/CollectionRules/ActionOptionsDependencyAnalyzer.cs
Outdated
Show resolved
Hide resolved
src/Tools/dotnet-monitor/CollectionRules/Options/Actions/CollectDumpOptions.cs
Outdated
Show resolved
Hide resolved
...rosoft.Diagnostics.Monitoring.Tool.UnitTestCommon/Options/CollectionRuleOptionsExtensions.cs
Show resolved
Hide resolved
Thank you for the approval @jander-msft! I have a few more comments from @wiktork, so I wait for you to approve as well to ensure I haven't miss any of your concerns. (I also don't have permission to merge PRs, so I'll need someone to ultimately merge it when it's ready 😅 ) |
Summary
Enable users to configure the artifact name for the following actions:
CollectDump
CollectExceptions
CollectGCDump
CollectLiveMetrics
CollectLogs
CollectStacks
CollectTrace
Furthermore, the following tokens have been added to bring parity with
createdump
and the environment variableDOTNET_DbgMiniDumpName
/COMPlus_DbgMiniDumpName
used in .NET 5 and beyond, as detailed here.$(Monitor.HostName)
gethostname()
$(Monitor.UnixTime)
To support these new tokens,
HostInfo
has been added to theCollectionRuleContext
that combines both the existingTimeProvider
property (that used to be present directly onCollectionRuleContext
) and a newHostName
property.Resolve #3917
Original Release Description (modified below for conciseness):
CollectDump
CollectExceptions
CollectGCDump
CollectLiveMetrics
CollectLogs
CollectStacks
CollectTrace
$(Monitor.HostName)
and$(Monitor.UnixTime)
Release Notes Entry
Adds support for overriding the artifact name for
Collect*
actions and adds new placeholders forHostName
andUnixTime
.