Share via


OtlpConfigurationExtensions.AddOtlpEnvironment Method

Definition

Configures OpenTelemetry in projects using environment variables.

public static void AddOtlpEnvironment (Aspire.Hosting.ApplicationModel.IResource resource, Microsoft.Extensions.Configuration.IConfiguration configuration, Microsoft.Extensions.Hosting.IHostEnvironment environment);
static member AddOtlpEnvironment : Aspire.Hosting.ApplicationModel.IResource * Microsoft.Extensions.Configuration.IConfiguration * Microsoft.Extensions.Hosting.IHostEnvironment -> unit
Public Sub AddOtlpEnvironment (resource As IResource, configuration As IConfiguration, environment As IHostEnvironment)

Parameters

resource
IResource

The resource to add annotations to.

configuration
IConfiguration

The configuration to use for the OTLP exporter endpoint URL.

environment
IHostEnvironment

The host environment to check if the application is running in development mode.

Applies to