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.
Methods
stage()
Return a no-op context manager, ignoring all arguments.
inject_context()No-op: leave `carrier` untouched when tracing is disabled.
No-op: no parent context to continue when tracing is disabled.
Source
View on GitHubpraisonaiagents/gateway/protocols.py at line 6829