QueryObserver

interface QueryObserver

Sees the outcome of every query a gateway runs: the hook a host's metrics (9.x QueryMetricsObserver, wired by the host in 6.2c), logs (QueryLogObserver) and audit trail implement. A query ends in exactly one of onComplete, onError and onCancel; when audits is set, onAudit follows with its QueryAudit. A cross-tenant query is audited whatever the observers: its audit is logged at INFO (QueryAudit.CROSS_TENANT_LOGGER).

start observes the query of a QueryModel as a stage of work: its span and its time, from its admission to its end; the gateway ends the Observation it returns once the query ends, telling it the failure it ended with.

Inheritors

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open val audits: Boolean

Whether this observer wants onAudit; the gateway builds audits only when one is wanted or must be logged.

Functions

Link copied to clipboard
open fun onAudit(audit: QueryAudit)

One QueryAudit per query, when it ends.

Link copied to clipboard
open fun onCancel(aggregateType: AggregateType, queryType: QueryType)
Link copied to clipboard
open fun onComplete(aggregateType: AggregateType, queryType: QueryType)
Link copied to clipboard
open fun onError(aggregateType: AggregateType, queryType: QueryType, error: Throwable)
Link copied to clipboard
open fun start(aggregateType: AggregateType, queryType: QueryType, model: QueryModel): Observation