2

According to the Microsoft documentation (found here: https://learn.microsoft.com/en-us/azure/application-insights/app-insights-api-custom-events-metrics), the MetricManager class can be used in the following way:

    // Initially:
var manager = new Microsoft.ApplicationInsights.Extensibility.MetricManager(telemetryClient);

// For each metric that you want to use:
var metric1 = mgr.CreateMetric("m1", dimensions);

// Each time you want to record a measurement:
metric1.Track(value);

I updated the Application Insights for ASP.NET library to version 2.4 (which is still in pre-release, by the way). However, the MetricManager class is not exposed publicly. When I decompose the dll, it looks like the MetricManager class is internal. Is this because the library hasn't officially been released yet?

TheDude
  • 1,421
  • 4
  • 29
  • 54

1 Answers1

1

The decision was made to wait with official release of this API, so it was moved marked as internal. It should be added back to 2.5 beta1 (potentially with changes to API surface).

ZakiMa
  • 5,637
  • 1
  • 24
  • 48
  • They should update the documentation then. I've been trying to get this to work for several hours with no luck https://learn.microsoft.com/en-us/azure/application-insights/app-insights-api-custom-events-metrics#send-metrics – esac May 16 '17 at 00:52
  • Fair point. It looks like the task was filed to remove documentation about MetricManager: https://github.com/Microsoft/ApplicationInsights-dotnet/issues/548. But it's still active. Should up updated soon. Sorry for inconvenience. – ZakiMa May 16 '17 at 06:28