OtlpConfigurationExtensions.WithOtlpExporter<T> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Injects the appropriate environment variables to allow the resource to enable sending telemetry to the dashboard.
- It sets the OTLP endpoint to the value of the DOTNET_DASHBOARD_OTLP_ENDPOINT_URL environment variable.
- It sets the service name and instance id to the resource name and UID. Values are injected by the orchestrator.
- It sets a small batch schedule delay in development. This reduces the delay that OTLP exporter waits to sends telemetry and makes the dashboard telemetry pages responsive.
public static Aspire.Hosting.ApplicationModel.IResourceBuilder<T> WithOtlpExporter<T> (this Aspire.Hosting.ApplicationModel.IResourceBuilder<T> builder) where T : Aspire.Hosting.ApplicationModel.IResourceWithEnvironment;
static member WithOtlpExporter : Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.IResourceWithEnvironment)> -> Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.IResourceWithEnvironment)> (requires 'T :> Aspire.Hosting.ApplicationModel.IResourceWithEnvironment)
<Extension()>
Public Function WithOtlpExporter(Of T As IResourceWithEnvironment) (builder As IResourceBuilder(Of T)) As IResourceBuilder(Of T)
Type Parameters
- T
The resource type.
Parameters
- builder
- IResourceBuilder<T>
The resource builder.
Returns
The IResourceBuilder<T>.