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

Microsoft.ApplicationInsights.Metrics.MetricSeries

public sealed class MetricSeries
Represents a data time series of metric values. One or more MetricSeries are grouped into a single Metric. Use MetricSeries to track, aggregate and send values without the overhead of looking them up from the corresponding Metric object. Each Metric object contains a special zero-dimension series, plus, for multi-dimensional metrics, one series per unique dimension-values combination.
public IReadOnlyDictionary<string, string> DimensionNamesAndValues { get; }

Gets a table that describes the names and values of the dimensions that describe this metric time series.

Gets the identifier of the metric that contains this metric time series.

public void TrackValue(double metricValue)

Includes the specified value into the current aggregate of this metric time series. An aggregate representing tracked values will be automatically sent to the cloud ingestion endpoint at the end of each aggregation period.

(Advanced note: When non-default aggregation cycles are active, additional aggregates may be obtained by cycling respective aggregators.)

public void TrackValue(object metricValue)

Includes the specified value into the current aggregate of this metric time series. An aggregate representing tracked values will be automatically sent to the cloud ingestion endpoint at the end of each aggregation period. This overload allows creating aggregators that can aggregate non-numeric values (e.g. a distinct count of strings aggregator).

(Advanced note: When non-default aggregation cycles are active, additional aggregates may be obtained by cycling respective aggregators.)