共用方式為


AutocollectedMetricsExtractor Class

Definition

Extracts auto-collected, pre-aggregated (aka. "standard") metrics from telemetry. Metric Extractors participate in the telemetry pipeline as telemetry processors. They examine telemetry items going through the pipeline and create pre-aggregated metrics based on the encountered items. The metrics can be anything. For example, one may choose to extract a metric for "Request Duration" from RequestTelemetry items. Or one may choose to create a metric "Cows Sold" from specific user-tracked EventTelemetry items that contain respective information.
Metric Extractors should be placed into the pipeline after telemetry initializers and before any telemetry processors that may perform any kind of filtering, e.g. before any sampling processors. Placing metric extractors after any filters will prevent them from seeing all potentially relevant telemetry which will skew the extracted metrics.
This extractor is responsible for aggregating auto-collected, pre-aggregated (aka. "standard") metrics, such as failed request count, dependency call durations and similar. Users may use the same pattern to create their own extractors for any metrics they want from any kind of telemetry. This extractor contains several implementations of the (internal) ISpecificAutocollectedMetricsExtractor-interface to which it delegates the aggregation of particular metrics. All those implementations share the same (dedicated) MetricManager-instance for metric aggregation.

public sealed class AutocollectedMetricsExtractor : IDisposable, Microsoft.ApplicationInsights.Extensibility.ITelemetryModule, Microsoft.ApplicationInsights.Extensibility.ITelemetryProcessor
type AutocollectedMetricsExtractor = class
    interface ITelemetryProcessor
    interface ITelemetryModule
    interface IDisposable
Public NotInheritable Class AutocollectedMetricsExtractor
Implements IDisposable, ITelemetryModule, ITelemetryProcessor
Inheritance
AutocollectedMetricsExtractor
Implements

Constructors

AutocollectedMetricsExtractor(ITelemetryProcessor)

Initializes a new instance of the AutocollectedMetricsExtractor class.

Properties

MaxDependencyCloudRoleInstanceValuesToDiscover

Gets or sets the maximum distinct values for CloudRoleInstance for Dependency telemetry. Values encountered after this limit is hit will be collapsed into a single value DIMENSION_CAPPED. Setting 0 will all values to be replaced with a single value "Other".

MaxDependencyCloudRoleNameValuesToDiscover

Gets or sets the maximum distinct values for CloudRoleName for Dependency telemetry. Values encountered after this limit is hit will be collapsed into a single value DIMENSION_CAPPED. Setting 0 will all values to be replaced with a single value "Other".

MaxDependencyResultCodesToDiscover

Gets or sets the maximum distinct values for Dependency Result Code. Types encountered after this limit is hit will be collapsed into a single value DIMENSION_CAPPED. Setting 0 will all values to be replaced with a single value "Other".

MaxDependencyTargetValuesToDiscover

Gets or sets the maximum distinct values for Dependency Target. Targets encountered after this limit is hit will be collapsed into a single value DIMENSION_CAPPED. Setting 0 will all values to be replaced with a single value "Other".

MaxDependencyTypesToDiscover

Gets or sets the maximum distinct values for DependencyType. Types encountered after this limit is hit will be collapsed into a single value DIMENSION_CAPPED. Setting 0 will all values to be replaced with a single value "Other".

MaxExceptionCloudRoleInstanceValuesToDiscover

Gets or sets the maximum distinct values for CloudRoleInstance for Exception telemetry. Values encountered after this limit is hit will be collapsed into a single value DIMENSION_CAPPED. Setting 0 will all values to be replaced with a single value "Other".

MaxExceptionCloudRoleNameValuesToDiscover

Gets or sets the maximum distinct values for CloudRoleName for Exception telemetry. Values encountered after this limit is hit will be collapsed into a single value DIMENSION_CAPPED. Setting 0 will all values to be replaced with a single value "Other".

MaxRequestCloudRoleInstanceValuesToDiscover

Gets or sets the maximum distinct values for CloudRoleInstance for Request telemetry. Values encountered after this limit is hit will be collapsed into a single value DIMENSION_CAPPED. Setting 0 will all values to be replaced with a single value "Other".

MaxRequestCloudRoleNameValuesToDiscover

Gets or sets the maximum distinct values for CloudRoleName for Request telemetry. Values encountered after this limit is hit will be collapsed into a single value DIMENSION_CAPPED. Setting 0 will all values to be replaced with a single value "Other".

MaxRequestResponseCodeValuesToDiscover

Gets or sets the maximum distinct values for Request response code. Targets encountered after this limit is hit will be collapsed into a single value DIMENSION_CAPPED. Setting 0 will all values to be replaced with a single value "Other".

MaxTraceCloudRoleInstanceValuesToDiscover

Gets or sets the maximum distinct values for CloudRoleInstance for Trace telemetry. Values encountered after this limit is hit will be collapsed into a single value DIMENSION_CAPPED. Setting 0 will all values to be replaced with a single value "Other".

MaxTraceCloudRoleNameValuesToDiscover

Gets or sets the maximum distinct values for CloudRoleName for Trace telemetry. Values encountered after this limit is hit will be collapsed into a single value DIMENSION_CAPPED. Setting 0 will all values to be replaced with a single value "Other".

Methods

Dispose()

Disposes this telemetry extractor.

Initialize(TelemetryConfiguration)

This class implements the ITelemetryModule interface by defining this method. It will be called by the infrastructure when the telemetry pipeline is being built. This will ensure that the extractor is initialized using the same TelemetryConfiguration as the rest of the pipeline. Specifically, this will also ensure that the TelemetryClient used internally for sending extracted metrics uses the same configuration.

Process(ITelemetry)

This class implements the ITelemetryProcessor interface by defining this method. This method will be called by the pipeline for each telemetry item that goes through it. It invokes Microsoft.ApplicationInsights.Extensibility.AutocollectedMetricsExtractor.ExtractMetrics(Microsoft.ApplicationInsights.Channel.ITelemetry) to actually do the extraction.

Applies to