-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Milestone
Description
Description
Unexpected TimeSeriesLimitReached after HistogramLimitReached and trying to add more histogram instrument,
and no more Instrument can be added in session.
Reproduction Steps
- begin to listen EventSource named "System.Diagnostics.Metrics" with "MaxTimeSeries" and "MaxHistograms" options
- must be
MaxTimeSeries > MaxHistograms(temporarily setMaxTimeSeries=3,MaxHistograms=2)
- must be
- create
System.Diagnostics.Metrics.Meter - create Histogram via it
- do
Histogram.Record3 times with different tag values(temporarily, "t1=1", "t1=2", "t1=3") - do
Histogram.Recordwith tag value which is same as last record(temporarily, "t1=3")
sample program is following
https://gist.github.com/itn3000/9001546f1a0a9bcd53b7bc0ae4184bbd
Expected behavior
raise "HistogramLimitReached" only, no "TimeSeriesLimitReached".
and another Instrument like Counter<T> can be started to listen after "HistogramLimitReached".
Actual behavior
raise "HistogramLimitReached" and "TimeSeriesLimitReached".
and no more Instrument can be started to listen after "TimeSeriesLimitReached"
Regression?
No response
Known Workarounds
- make "MaxHistograms" large to exceed possible histogram number
- avoiding do
Histogram.Recordwhich not listening(if it can)
Configuration
- dotnet-sdk: 6.0.0-rc2
- OS: win10-x64
Other information
I suspect around the "CheckTimeSeriesAllowed" and "CheckHistramAllowed"(currentTimeSeries is increased even if after reaching MaxHistograms?)
Lines 305 to 307 in 565f3ee
| return (!CheckTimeSeriesAllowed() || !CheckHistogramAllowed()) ? | |
| null : | |
| new ExponentialHistogramAggregator(s_defaultHistogramConfig); |