Interface ICosmosQueryLogSink
A sink for Cosmos query diagnostics. Implementations receive a CosmosQueryDiagnostics event for every query execution the library captures — point operations, feed response pages, and query totals.
Namespace: Benday.CosmosDb.Diagnostics
Assembly: Benday.CosmosDb.dll
Syntax
public interface ICosmosQueryLogSink
Remarks
Implementations are registered in the DI container (typically as
singletons) and injected into CosmosRepository<T> instances.
A default NoOpCosmosQueryLogSink is registered
automatically if no other sink is configured, so consumers only
register a sink when they want non-default behavior.
The Record(CosmosQueryDiagnostics) method is synchronous and fire-and-forget from the library's perspective. Sinks that need async I/O (file writes, network calls) should buffer internally and flush from a background worker — the library will not await the sink and will not retry on failure.
Exceptions thrown from Record(CosmosQueryDiagnostics) are caught by the
library, logged as warnings to ILogger, and suppressed. A
broken sink must not prevent a query from completing.
Methods
| Edit this page View SourceRecord(CosmosQueryDiagnostics)
Records a diagnostics event. Called synchronously from the library on the thread that executed the query.
Declaration
void Record(CosmosQueryDiagnostics diagnostics)
Parameters
| Type | Name | Description |
|---|---|---|
| CosmosQueryDiagnostics | diagnostics | The diagnostics payload for this event. Never null. |