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

Microsoft.ApplicationInsights.Metrics.Extensibility.MetricManagerExtensions

Some methods on MetricManager.AggregationManager need public access. However, the property AggregationManager on MetricManager is not public, nor is the type of that property (MetricAggregationManager). This class exposes the necesary APIs in a specialized namespace, while avoiding polluting the API surface shown by Intellisense for users who do not import the ...Extensibility namespace.
public static AggregationPeriodSummary StartOrCycleAggregators(this MetricManager metricManager, MetricAggregationCycleKind aggregationCycleKind, DateTimeOffset tactTimestamp, IMetricSeriesFilter futureFilter)

If the specified aggragation cycle is not active, it is started. If is is already active, it is completed, and a new cycle is started.

public static AggregationPeriodSummary StopAggregators(this MetricManager metricManager, MetricAggregationCycleKind aggregationCycleKind, DateTimeOffset tactTimestamp)

Stop the specified aggregation cycle for the specified manager and return the aggregates.

public static Task StopDefaultAggregationCycleAsync(this MetricManager metricManager)

Stops metric aggregation in advanced scenarios where a MetricManager was explicitly created using its ctor.