Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet-counter doesn't display UpDownCounter #3742

Closed
JamesNK opened this issue Mar 14, 2023 · 0 comments · Fixed by #3849
Closed

dotnet-counter doesn't display UpDownCounter #3742

JamesNK opened this issue Mar 14, 2023 · 0 comments · Fixed by #3849
Assignees
Labels
bug Something isn't working dotnet-counters
Milestone

Comments

@JamesNK
Copy link
Member

JamesNK commented Mar 14, 2023

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.