microsoft / ApplicationInsights-node.js

Microsoft Application Insights SDK for Node.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

customMetrics problems

skhilliard opened this issue · comments

When upgrading from 2.x to 3.0.1, we are seeing a lot of warnings like this...

  • Invalid metric name: "\ASP.NET Applications(??APP_W3SVC_PROC??)\Request Execution Time". The metric name should be a ASCII string with a length no greater than 255 characters. []
  • Invalid metric name: "\ASP.NET Applications(??APP_W3SVC_PROC??)\Requests/Sec". The metric name should be a ASCII string with a length no greater than 255 characters. []
  • Invalid metric name: "\Process(??APP_WIN32_PROC??)\Private Bytes". The metric name should be a ASCII string with a length no greater than 255 characters. []
  • Invalid metric name: "\Memory\Available Bytes". The metric name should be a ASCII string with a length no greater than 255 characters. []
  • Invalid metric name: "\Processor(_Total)\% Processor Time". The metric name should be a ASCII string with a length no greater than 255 characters. []
  • Invalid metric name: "\Process(??APP_WIN32_PROC??)\% Processor Time". The metric name should be a ASCII string with a length no greater than 255 characters. []
  • Invalid metric name: "Redis Health Check". The metric name should be a ASCII string with a length no greater than 255 characters. []

The first 6 of these aren't generated by any metrics we are doing, which is odd. The last one is one that we are using. It seems like the code doesn't like the fact that we have spaces in the metric name, which was allowed before. I do still see these appearing in metrics though, so it seems like a false warning.

Also, it looks like different instances of these sometimes get aggregated with 3.x, which isn't good for metrics...for example:

image

vs. 2.x

image

@skhilliard Those first 6 warnings are performance counters. You can disable them via configuration options in Application Insights if you don't need them and want to remove the warnings. A fix will be applied to the Azure Monitor Exporter that will remove these warnings.

Your last metric "Redis Health Check" is invalid because of added spaces. This is another effect of moving to OpenTelemetry under the hood in 3.X and something I believe is worth updating in the migration guide. Thank you for your input there!

If you want fine grain control of how metrics are collected, I'd suggest following the migration guide above and moving to the Azure Monitor OpenTelemetry. Application Insights version 3.X is intended to be an easy upgrade path for those who have basic instrumentations with 2.X, while if you want more control and the advantages of OpenTelemetry, it's best to take advantage of the Azure Monitor OpenTelemetry.