<PackageReference Include="Serilog.Sinks.OpenTelemetry" Version="4.2.1-dev-02318" />

Serilog.Sinks.OpenTelemetry.OpenTelemetrySinkOptions

Initialization options for OpenTelemetrySink.
public string Endpoint { get; set; }

The URL of the OTLP exporter endpoint. This should include full scheme, host, and port information. When the protocol is HttpProtobuf, this may also include path information, but the standard OTLP path components /v1/logs and /v1/traces should not be specified, and will be trimmed if present. Set this value to and specify one of either LogsEndpoint or TracesEndpoint if only a single signal is desired.

public IFormatProvider FormatProvider { get; set; }

Supplies culture-specific formatting information, or null.

public IDictionary<string, string> Headers { get; set; }

Headers to send with network requests.

A custom HTTP message handler. To suppress tracing of HTTP requests from the sink, set the handler to a SocketsHttpHandler with nullActivityHeadersPropagator: options.HttpMessageHandler = new SocketsHttpHandler { ActivityHeadersPropagator = null };

public IncludedData IncludedData { get; set; }

Which fields should be included in the log events generated by the sink. The default is to include TraceId and SpanId when Current is not null, and message_template.text.

public LoggingLevelSwitch LevelSwitch { get; set; }

A switch allowing the pass-through minimum level to be changed at runtime.

public string LogsEndpoint { get; set; }

Override the URL for the OTLP exporter logs endpoint. This should be a full URL, and if the protocol is HttpProtobuf this should include path components like /v1/logs. By default, an endpoint will be computed from Endpoint.

public Func<bool, IDisposable> OnBeginSuppressInstrumentation { get; set; }

A callback used by the sink before triggering behaviors that may themselves generate log or trace information. Set this value to OpenTelemetry.SuppressInstrumentationScope.Begin when using this sink in applications that instrument HTTP or gRPC requests using OpenTelemetry.

public OtlpProtocol Protocol { get; set; }

The OTLP protocol to use.

public IDictionary<string, object> ResourceAttributes { get; set; }

A attributes of the resource attached to the logs generated by the sink. The values must be simple primitive values: integers, doubles, strings, or booleans. Other values will be silently ignored.

public LogEventLevel RestrictedToMinimumLevel { get; set; }

The minimum level for events passed through the sink. The default value is to not restrict events based on level. Ignored when LevelSwitch is specified.

public string TracesEndpoint { get; set; }

Override the URL for the OTLP exporter traces endpoint. This should be a full URL, and if the protocol is HttpProtobuf this should include path components like /v1/traces. By default, an endpoint will be computed from Endpoint.