Class NpgsqlTracingOptionsBuilder
- Namespace
- Npgsql
- Assembly
- Npgsql.dll
A builder to configure Npgsql's support for OpenTelemetry tracing.
public sealed class NpgsqlTracingOptionsBuilder
- Inheritance
-
NpgsqlTracingOptionsBuilder
- Inherited Members
Methods
ConfigureBatchEnrichmentCallback(Action<Activity, NpgsqlBatch>?)
Configures a callback that can enrich the Activity emitted for the given NpgsqlBatch.
public NpgsqlTracingOptionsBuilder ConfigureBatchEnrichmentCallback(Action<Activity, NpgsqlBatch>? batchEnrichmentCallback)
Parameters
batchEnrichmentCallback
Action<Activity, NpgsqlBatch>
Returns
ConfigureBatchFilter(Func<NpgsqlBatch, bool>?)
Configures a filter function that determines whether to emit tracing information for an NpgsqlBatch. By default, tracing information is emitted for all batches.
public NpgsqlTracingOptionsBuilder ConfigureBatchFilter(Func<NpgsqlBatch, bool>? batchFilter)
Parameters
batchFilter
Func<NpgsqlBatch, bool>
Returns
ConfigureBatchSpanNameProvider(Func<NpgsqlBatch, string?>?)
Configures a callback that provides the tracing span's name for an NpgsqlBatch. If null
, the default standard
span name is used, which is the database name.
public NpgsqlTracingOptionsBuilder ConfigureBatchSpanNameProvider(Func<NpgsqlBatch, string?>? batchSpanNameProvider)
Parameters
batchSpanNameProvider
Func<NpgsqlBatch, string>
Returns
ConfigureCommandEnrichmentCallback(Action<Activity, NpgsqlCommand>?)
Configures a callback that can enrich the Activity emitted for the given NpgsqlCommand.
public NpgsqlTracingOptionsBuilder ConfigureCommandEnrichmentCallback(Action<Activity, NpgsqlCommand>? commandEnrichmentCallback)
Parameters
commandEnrichmentCallback
Action<Activity, NpgsqlCommand>
Returns
ConfigureCommandFilter(Func<NpgsqlCommand, bool>?)
Configures a filter function that determines whether to emit tracing information for an NpgsqlCommand. By default, tracing information is emitted for all commands.
public NpgsqlTracingOptionsBuilder ConfigureCommandFilter(Func<NpgsqlCommand, bool>? commandFilter)
Parameters
commandFilter
Func<NpgsqlCommand, bool>
Returns
ConfigureCommandSpanNameProvider(Func<NpgsqlCommand, string?>?)
Configures a callback that provides the tracing span's name for an NpgsqlCommand. If null
, the default standard
span name is used, which is the database name.
public NpgsqlTracingOptionsBuilder ConfigureCommandSpanNameProvider(Func<NpgsqlCommand, string?>? commandSpanNameProvider)
Parameters
commandSpanNameProvider
Func<NpgsqlCommand, string>
Returns
EnableFirstResponseEvent(bool)
Gets or sets a value indicating whether to enable the "time-to-first-read" event. Default is true to preserve existing behavior.
public NpgsqlTracingOptionsBuilder EnableFirstResponseEvent(bool enable = true)
Parameters
enable
bool