Null Gateway Trace Hook • AI Agent SDK

NullGatewayTraceHook: Zero-cost no-op :class:`GatewayTraceHook` used when tracing is disabled.

NullGatewayTraceHook

Defined in the protocols module.

AI Agent

Zero-cost no-op :class:GatewayTraceHook used when tracing is disabled.

Every stage call returns a lightweight, argument-ignoring null context manager (one small allocation per call), so firing the seam adds negligible overhead on the hot path. This is the default a gateway uses until an exporter plugin (e.g. the OTel/OTLP plugin in `praisonai-plugins`) is supplied.

Diagram

Allow

Deny

Event Trigger

Hook: NullGatewayTraceHook

Decision

Process

Block

Methods

Source

View on GitHub

praisonaiagents/gateway/protocols.py at line 6829


Related Documentation