Share via


TelemetryConfiguration Class

Definition

Encapsulates the global telemetry configuration typically loaded from the ApplicationInsights.config file.

public sealed class TelemetryConfiguration : IDisposable
type TelemetryConfiguration = class
    interface IDisposable
Public NotInheritable Class TelemetryConfiguration
Implements IDisposable
Inheritance
TelemetryConfiguration
Implements

Remarks

All TelemetryContext objects are initialized using the Active telemetry configuration provided by this class.

Constructors

TelemetryConfiguration(String, ITelemetryChannel)
Obsolete.

Initializes a new instance of the TelemetryConfiguration class.

TelemetryConfiguration(String)
Obsolete.

Initializes a new instance of the TelemetryConfiguration class.

Properties

Active
Obsolete.

Gets the active TelemetryConfiguration instance loaded from the ApplicationInsights.config file. If the configuration file does not exist, the active configuration instance is initialized with minimum defaults needed to send telemetry to Application Insights.

ApplicationIdProvider

Gets or sets the Application Id Provider.

ConnectionString

Gets or sets the connection string. Setting this value will also set (and overwrite) the InstrumentationKey. The endpoints are validated and will be set (and overwritten) for InMemoryChannel and ServerTelemetryChannel as well as the ApplicationIdProvider.

DefaultTelemetrySink

Gets the default telemetry sink.

DisableTelemetry

Gets or sets a value indicating whether sending of telemetry to Application Insights is disabled.

EndpointContainer

Gets the Endpoint Container responsible for making service endpoints available.

InstrumentationKey
Obsolete.

Gets or sets the default instrumentation key for the application.

TelemetryChannel

Gets or sets the telemetry channel for the default sink. Will also attempt to set the Channel's endpoint.

TelemetryInitializers

Gets the list of ITelemetryInitializer objects that supply additional information about telemetry.

TelemetryProcessorChainBuilder

Gets the TelemetryProcessorChainBuilder which can build and populate TelemetryProcessors in the TelemetryConfiguration.

TelemetryProcessors

Gets a readonly collection of TelemetryProcessors.

TelemetrySinks

Gets a list of telemetry sinks associated with the configuration.

Methods

CreateDefault()

Creates a new TelemetryConfiguration instance loaded from the ApplicationInsights.config file. If the configuration file does not exist, the new configuration instance is initialized with minimum defaults needed to send telemetry to Application Insights.

CreateFromConfiguration(String)

Creates a new TelemetryConfiguration instance loaded from the specified configuration.

Dispose()

Releases resources used by the current instance of the TelemetryConfiguration class.

SetAzureTokenCredential(Object)

Set a TokenCredential for this configuration.

Extension Methods

GetMetricManager(TelemetryConfiguration)

TelemetryConfiguration.GetMetricManager(..) is a internal method to avoid puluting the public surface. You can use the namespace Microsoft.ApplicationInsights.Extensibility to get access to the MetricManager via this extension method.

Applies to