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

All perf counters stop being collected when any of faulty counters are specified to collect on Azure WebApps #1686

Closed
tukaef opened this issue Feb 16, 2020 · 3 comments
Labels

Comments

@tukaef
Copy link
Contributor

tukaef commented Feb 16, 2020

This is a consequence of #1685. When any of the counters in question is specified, the collector stops collecting the other counters after 5-6 successful iterations.

Repro Steps

  1. Specify any of the following counters to collect:
  • \.NET CLR Memory(??APP_CLR_PROC??)\# Total committed Bytes
  • \ASP.NET Applications(??APP_W3SVC_PROC??)\Request Bytes In Total
  • \ASP.NET Applications(??APP_W3SVC_PROC??)\Request Bytes Out Total
  1. Specify any other counter, or just leave the default counters

Actual Behavior

After deploy, all counters apart from the faulty ones are collected and sent only 5-6 times (a few minutes). After that, nothing is collected (nor sent).

Expected Behavior

Non-faulty counters being collected successfully during the app lifetime.

Version Info

SDK Version : 2.12.1
.NET Version : 4.7
Hosting Info : Azure WebApps

@tukaef tukaef changed the title All perf counters stop being collected when any of faulty counters are specified to collect on Azure WebApp All perf counters stop being collected when any of faulty counters are specified to collect on Azure WebApps Feb 16, 2020
@tukaef
Copy link
Contributor Author

tukaef commented Feb 16, 2020

This is likely due to WebAppPerformanceCollector.RefreshCounters throwing an exception when PerformanceCollectorModule.EnsurePerformanceCountersRegistered is called. Since it's not caught on the way, we end up not updating lastRefreshTimestamp (line 369). Which in turn makes EnsurePerformanceCountersRegistered be always trying to refresh counters, and thus failing the whole iteration (timer tick) before any counters are collected.

Is it possible to catch the exception in WebAppPerformanceCollector.RefreshPerformanceCounter method? Could submit a PR if so.
This would be similar to what's implemented in StandardPerformanceCollector.

@TimothyMothra
Copy link
Member

Hi, your explanation makes sense.
I don't have time to investigate this right now, but we would gladly accept your PR. :)

@cijothomas
Copy link
Contributor

@tukaef Thanks for reporting and investigating the issue. Please submit a PR if you have time.

@cijothomas cijothomas added the bug label Feb 24, 2020
tukaef added a commit to tukaef/ApplicationInsights-dotnet that referenced this issue Feb 25, 2020
tukaef added a commit to tukaef/ApplicationInsights-dotnet that referenced this issue Feb 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants