microsoft / ApplicationInsights-dotnet-server

Microsoft Application Insights for .NET Web Applications
https://azure.microsoft.com/services/application-insights/
133 stars 67 forks source link

Avoid sending error message about perf counter error when running in Linux/Mac #1186

Closed cijothomas closed 5 years ago

cijothomas commented 5 years ago

PerfCounters were enabled for Windows in ..NET Core in the following PRs. https://github.com/microsoft/ApplicationInsights-dotnet-server/pull/1157 https://github.com/microsoft/ApplicationInsights-dotnet-server/pull/1148

When the app is deployed in Linux where perf counters are not supported, LiveMetrics logs Error levels trace messages, which are sent by DiagnosticModule to user's instrumentation key. This is likely noise.

Proposal is to detect OS platform and act accordingly.

cijothomas commented 5 years ago

fixed in https://github.com/microsoft/ApplicationInsights-dotnet-server/issues/1189