MetricsBuilderConfigurationExtensions.AddConfiguration Method

Definition

Reads metrics configuration from the provided IConfiguration section and configures which Meters, Instruments, and IMetricsListeners are enabled.

public static Microsoft.Extensions.Diagnostics.Metrics.IMetricsBuilder AddConfiguration (this Microsoft.Extensions.Diagnostics.Metrics.IMetricsBuilder builder, Microsoft.Extensions.Configuration.IConfiguration configuration);

Parameters

configuration
IConfiguration

The IConfiguration section to load.

Returns

The original IMetricsBuilder for chaining.

Applies to

Prodotto Versioni
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)