Expand description
Tracing/observability instrumentation guards.
When the tracing feature is disabled, all guards are zero-sized types
with no-op constructors — eliminated entirely by the compiler.
§Usage
Providers and connections create guards at the start of instrumented
operations. The guard emits a tracing event on Drop:
QueryGuard— wraps a singlequery/executecall; emitsDEBUGon completion,WARNif the elapsed time exceeds the slow-query threshold.PoolAcquireGuard— wraps a connection-pool acquisition; emitsINFOwith the acquire duration.SaveChangesGuard— wraps asave_changescall; emitsINFOwith the total elapsed time.
Structs§
- Pool
Acquire Guard - Query
Guard - No-op stub when tracing is disabled — zero-sized, eliminated by compiler.
- Save
Changes Guard