Closed sandersaares closed 1 year ago
Interesting, thanks for the research @sandersaares. If this is the case then yeah, let's go with disabling recycling for .NET 6.0 (from memory this would leave it only enabled for .NET 5.0). I can submit an MR later this week or so.
Hey @sandersaares, I just double checked and by default recycling isn't enabled for any runtime (although you can choose to enable it via RecycleCollectorsEvery
).
It seems to default to 24 hours here for net50: https://github.com/djluck/prometheus-net.DotNetRuntime/blob/aa9fb94ac63643aeef2ac1a11d6a57f8378d9aac/src/prometheus-net.DotNetRuntime/DotNetRuntimeStatsCollector.cs#L205
Am I misreading the code somehow? Seems to match what I observe happening.
Apologies, I missed that (it's been a while since I've looked at this code!). I've just published v4.3.0 which targets .net60 and as a result, should see collector recycling only enabled by default for .net50.
Thanks! I confirm this seems to fix it.
Recycling collectors can apparently crash .NET 6.0 runtime:
I would therefore like to disable recycling. If I understand it right, the recycling is no longer necessary with .NET 6.0 anyway, right? (Based on comments in https://github.com/dotnet/runtime/issues/43985)
However, it seems that there is no option for this!
RecycleCollectorsEvery()
does not accept a null/zero parameter. I request that this option be added and/or recycling be disabled from 6.0 onwards if it is no longer relevant.