Skip to content

Commit 17fa0c8

Browse files
authored
fix unexpected TimeSeriesLimitReached after HistogramLimitReached(#60752) (#61199)
1 parent d2415c4 commit 17fa0c8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/AggregationManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,8 @@ private void RemoveInstrumentState(Instrument instrument, InstrumentState state)
302302
{
303303
lock (this)
304304
{
305-
return (!CheckTimeSeriesAllowed() || !CheckHistogramAllowed()) ?
305+
// checking currentHistograms first because avoiding unexpected increment of TimeSeries count.
306+
return (!CheckHistogramAllowed() || !CheckTimeSeriesAllowed()) ?
306307
null :
307308
new ExponentialHistogramAggregator(s_defaultHistogramConfig);
308309
}

0 commit comments

Comments
 (0)