Application Insights - 自定义性能计数器

Application Insights - Custom Performance Counter

我可以实例化一个新的性能计数器对象,但我怎样才能 "track" 它呢?有 "TrackTrace"、"TrackException" 等,但没有 "TrackPerformanceCounter"... 有解决办法吗?

如果您使用的是真实的性能计数器,那么您可以配置 applicationinsights.config 来收集该性能计数器,它会正常发生。 (https://docs.microsoft.com/en-us/azure/application-insights/app-insights-performance-counters)

<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.PerformanceCollectorModule, Microsoft.AI.PerfCounterCollector">
  <Counters>
    <Add PerformanceCounter="\Objects\Processes"/>
    <Add PerformanceCounter="\Sales(photo)\# Items Sold" ReportAs="Photo sales"/>
  </Counters>
</Add>

如果您不使用真正的性能计数器而只是想跟踪一个数字的值,您可以直接使用 TrackMetric(nameOfThing, valueOfThing),或者您可以随时通过以下方式跟踪该指标的值在任何 TrackEvent( nameOfEvent, properties, metrics) 调用的 metrics 参数中传递它。

没有解决方法...在 GITHUB 项目中有一些未解决的问题 increase/configure 数据捕获的重复,但截至 sep/2017

没有具体的问题