<PackageReference Include="Microsoft.ApplicationInsights" Version="3.1.2" />

Microsoft.ApplicationInsights.Metrics.MetricsManager

sealed class MetricsManager : IDisposable
Manages OpenTelemetry Meter and Histogram instruments for metrics tracking. Provides a centralized cache for histogram instances to ensure efficient metric recording.
public MetricsManager(string meterName = "Microsoft.ApplicationInsights")

Initializes a new instance of the MetricsManager class.

public void Dispose()

Disposes the meter and all associated instruments.

public Histogram<double> GetOrCreateHistogram(string metricName, string metricNamespace = null)

Gets or creates a histogram instrument for the specified metric name. Histogram instances are cached and reused for efficiency.