Skip to content

dotnet-counter doesn't display UpDownCounter #3742

@JamesNK

Description

@JamesNK

Description

I'm experimenting with adding metrics to ASP.NET Core (and eventually alongside most or all existing event source counters). See dotnet/aspnetcore#46834

An UpDownCounter<long> created in my app isn't displayed alongside other metrics counters. It appears that publishing data for UpDownCounter and ObserverableUpDownCounter was recently fixed in dotnet/runtime#81041 but there wasn't any logic added to consume the value in CounterMonitor:

if (obj.EventName == "BeginInstrumentReporting")
{
HandleBeginInstrumentReporting(obj);
}
if (obj.EventName == "HistogramValuePublished")
{
HandleHistogram(obj);
}
else if (obj.EventName == "GaugeValuePublished")
{
HandleGauge(obj);
}
else if (obj.EventName == "CounterRateValuePublished")
{
HandleCounterRate(obj);
}
else if (obj.EventName == "TimeSeriesLimitReached")
{
HandleTimeSeriesLimitReached(obj);
}
else if (obj.EventName == "HistogramLimitReached")
{
HandleHistogramLimitReached(obj);
}
else if (obj.EventName == "Error")
{
HandleError(obj);
}
else if (obj.EventName == "ObservableInstrumentCallbackError")
{
HandleObservableInstrumentCallbackError(obj);
}
else if (obj.EventName == "MultipleSessionsNotSupportedError")
{
HandleMultipleSessionsNotSupportedError(obj);
}

Also test whether dotnet-monitor works with these counter types.

Configuration

.NET 8 web app publishing counters.

dotnet-counters --version
7.0.410101+f99383213ea19741908f5aa3cf0ed400db2e5f0a

Regression?

Unknown

Other information

cc @noahfalk

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions