OpenTelemetryHostedFileClientBuilderExtensions.UseOpenTelemetry 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.
Adds OpenTelemetry support to the hosted file client pipeline.
public static Microsoft.Extensions.AI.HostedFileClientBuilder UseOpenTelemetry(this Microsoft.Extensions.AI.HostedFileClientBuilder builder, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory = default, string? sourceName = default, Action<Microsoft.Extensions.AI.OpenTelemetryHostedFileClient>? configure = default);
static member UseOpenTelemetry : Microsoft.Extensions.AI.HostedFileClientBuilder * Microsoft.Extensions.Logging.ILoggerFactory * string * Action<Microsoft.Extensions.AI.OpenTelemetryHostedFileClient> -> Microsoft.Extensions.AI.HostedFileClientBuilder
<Extension()>
Public Function UseOpenTelemetry (builder As HostedFileClientBuilder, Optional loggerFactory As ILoggerFactory = Nothing, Optional sourceName As String = Nothing, Optional configure As Action(Of OpenTelemetryHostedFileClient) = Nothing) As HostedFileClientBuilder
Parameters
- builder
- HostedFileClientBuilder
- loggerFactory
- ILoggerFactory
An optional ILoggerFactory to use to create a logger for logging events.
- sourceName
- String
An optional source name that will be used on the telemetry data.
- configure
- Action<OpenTelemetryHostedFileClient>
An optional callback that can be used to configure the OpenTelemetryHostedFileClient instance.
Returns
The builder.
Remarks
Since there is currently no OpenTelemetry Semantic Convention for hosted file operations, this implementation uses general client span conventions alongside standard file.* registry attributes where applicable. The telemetry output is subject to change as relevant conventions emerge.