Skip to content

Unexpected TimeSeriesLimitReached after HistogramLimitReached #60752

Closed
@itn3000

Description

@itn3000

Description

Unexpected TimeSeriesLimitReached after HistogramLimitReached and trying to add more histogram instrument,
and no more Instrument can be added in session.

Reproduction Steps

  1. begin to listen EventSource named "System.Diagnostics.Metrics" with "MaxTimeSeries" and "MaxHistograms" options
    • must be MaxTimeSeries > MaxHistograms(temporarily set MaxTimeSeries=3, MaxHistograms=2)
  2. create System.Diagnostics.Metrics.Meter
  3. create Histogram via it
  4. do Histogram.Record 3 times with different tag values(temporarily, "t1=1", "t1=2", "t1=3")
  5. do Histogram.Record with 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.Record which 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?)

return (!CheckTimeSeriesAllowed() || !CheckHistogramAllowed()) ?
null :
new ExponentialHistogramAggregator(s_defaultHistogramConfig);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions