Search code examples
c#azureazure-application-insightsmetric

Unable to use MetricManager in ApplicationInsights


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?


Solution

  • 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).