-
Notifications
You must be signed in to change notification settings - Fork 64
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
feat: New Garbage Collection Metrics Sampler for .NET 6+ #2838
Conversation
…ic/newrelic-dotnet-agent into feature/modern-gc-sampler
If I'm following the code correctly, the first time through the |
@chynesNR Originally, I had code in place to wait until at least once GC had completed before sending up any data - which pretty much matches what OTel is doing. I took that out a couple days ago because it didn't seem like our other GC samplers behaved that way. I can go either way with it. @nrcventura |
src/Agent/NewRelic/Agent/Core/Samplers/GCSamplerV2ReflectionHelper.cs
Outdated
Show resolved
Hide resolved
I think either approach will ultimately be fine. However, if we do wait to report the first value, the charts might be able to scale themselves better. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2838 +/- ##
==========================================
+ Coverage 81.33% 81.43% +0.09%
==========================================
Files 460 464 +4
Lines 29239 29496 +257
Branches 3231 3261 +30
==========================================
+ Hits 23781 24019 +238
- Misses 4666 4682 +16
- Partials 792 795 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Description
Adds a new garbage collection metrics sampler that leverages the .NET APIs available in .NET 6 and later, instead of the existing (and somewhat error prone) Event Listener sampler. Available only for applications that target .NET 6 and later.
The new sampler is disabled by default but can be enabled either via
newrelic.config
:or environment variable:
When the new sampler is enabled, the Event Listener sampler is disabled. Additionally, a supportability metric,
Supportability/Dotnet/GCSamplerV2/Enabled
is sent when the new sampler is enabled.The set of garbage collection metrics reported by the new sampler are different from those reported by the Event Listener sampler, as detailed below:
GC/Handles
GC/Induced
GC/Gen0/Size
GC/Gen0/Promoted
GC/Gen0/Collections
GC/Gen0/Fragmentation
GC/Gen1/Size
GC/Gen1/Promoted
GC/Gen1/Collections
GC/Gen1/Fragmentation
GC/Gen2/Size
GC/Gen2/Promoted
GC/Gen2/Survived
GC/Gen2/Collections
GC/Gen2/Fragmentation
GC/LOH/Size
GC/LOH/Survived
GC/LOH/Collections
GC/LOH/Fragmentation
GC/POH/Size
GC/POH/Collections
GC/POH/Fragmentation
GC/Heap/Total
GC/Heap/Committed
GC/Heap/Allocated
Author Checklist
Reviewer Checklist