<PackageReference Include="Microsoft.ApplicationInsights" Version="3.0.0-rc1" />

Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration

public sealed class TelemetryConfiguration : IDisposable
Encapsulates the global telemetry configuration typically loaded from the ApplicationInsights.config file.
public string ConnectionString { get; set; }

Gets or sets the connection string.

public bool? DisableOfflineStorage { get; set; }

Gets or sets a value indicating whether offline storage is disabled. When null, the Azure Monitor Exporter default of false (offline storage enabled) is used.

public bool DisableTelemetry { get; set; }

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

public bool? EnableLiveMetrics { get; set; }

Gets or sets a value indicating whether Live Metrics is enabled. When null, the Azure Monitor Exporter default of true is used.

public bool? EnableTraceBasedLogsSampler { get; set; }

Gets or sets a value indicating whether trace-based log sampling is enabled. When null, the Azure Monitor Exporter default of true is used.

public float? SamplingRatio { get; set; }

Gets or sets the sampling ratio for traces (0.0 to 1.0). A value of 1.0 means all telemetry is sent, 0.5 means 50% is sent. When null, rate limiting sampling is used instead.

public string StorageDirectory { get; set; }

Gets or sets the directory for offline telemetry storage. When null, the Azure Monitor Exporter default (system default location) is used.

public double? TracesPerSecond { get; set; }

Gets or sets the number of traces per second for rate-limited sampling. Rate limited sampling is the default form of sampling.

Initializes a new instance of the TelemetryConfiguration class.

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.

public void ConfigureOpenTelemetryBuilder(Action<IOpenTelemetryBuilder> configure)

Allows extending the OpenTelemetry builder configuration.

public void Dispose()

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

public void SetAzureTokenCredential(TokenCredential tokenCredential)

Set a TokenCredential for this configuration.