nemoguardrails.tracing.spans
Span models for NeMo Guardrails tracing system.
Module Contents
Classes
Functions
Data
API
Bases: BaseSpan
Span for an action execution (internal span).
Convert to OTel attributes.
Bases: BaseModel
Base span with common fields across all span types.
Get common attributes for all span types.
Convert typed fields to legacy OpenTelemetry attributes dictionary.
Returns: Dict[str, Any]
Dict containing OTel semantic convention attributes.
Bases: BaseSpan
Top-level span for a guardrails interaction (server span).
Convert to OTel attributes.
Bases: BaseSpan
Span for an LLM API call (client span).
Convert to OTel attributes.
Bases: BaseSpan
Span for a guardrail execution (internal span).
Convert to OTel attributes.
Bases: BaseModel
Event that can be attached to a span.
Bases: enum.Enum
Bases: BaseModel
Simple span model (v1) for basic tracing.
Check if an object is a typed span (V2).
Parameters:
Object to check
Returns: bool
True if the object is a typed span, False otherwise