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

Microsoft.ApplicationInsights.Metrics.MetricManager

public sealed class MetricManager
A metric manager coordinates metrics aggregation at a specific scope. It keeps track of the known metrics and is ultimately responsibe for correctly initializing metric data time series. Note that a metric manager deals with zero dimensional time series. Metric objects are multidimensional collections of such series and the manager merely holds a collection of such containers for its scope.
public MetricsCollection Metrics { get; }

Gets the collection of metrics available the this manager's scope.

public MetricManager(IMetricTelemetryPipeline telemetryPipeline)

Initializes a new metric manager.

public MetricSeries CreateNewSeries(string metricNamespace, string metricId, IMetricSeriesConfiguration config)

Creates and initilizes a new metric data time series.

public MetricSeries CreateNewSeries(string metricNamespace, string metricId, IEnumerable<KeyValuePair<string, string>> dimensionNamesAndValues, IMetricSeriesConfiguration config)

Creates and initilizes a new metric data time series.

public MetricSeries CreateNewSeries(MetricIdentifier metricIdentifier, IEnumerable<KeyValuePair<string, string>> dimensionNamesAndValues, IMetricSeriesConfiguration config)

Creates and initilizes a new metric data time series.

public void Flush()

Flushes cached metric data. The default aggregation cycle will be completed/restarted if required.