Skip to main content

Understanding Span Attributes

Each span you query from LLM Gateway captures key request and model details. Recognizing these attributes helps you analyze and debug usage effectively.

Core Span Attributes

Request Context Attributes

Model Attributes

Model Performance Metrics

Load Balancing Attributes

Budget Control Attributes

Rate Limiting Attributes

MCP (Model Context Protocol) Server Attributes

MCP Server Metrics

Guardrail Attributes

Guardrail result values

Triggered guardrails on request spans

Individual guardrail checks each get their own Guardrail child span. Their outcomes are also rolled up onto the enclosing request span, so you can find requests affected by a guardrail without expanding the trace. The roll-up sets both tfy.triggered_guardrail_fqns and tfy.guardrail.result, and applies to ChatCompletion, AgentResponse, and MCPGateway spans. A few things to know when querying it:
  • pass and audit_mode_flag are not rolled up. Only outcomes that actually affected the request appear — flag, error, mutation, and ignored_error. A request whose guardrails all passed carries neither attribute.
  • Errors are included on purpose, so a guardrail that failed to run is distinguishable from one that ran and passed.
  • tfy.guardrail.result on a request span is a single worst-case value. When several guardrails trigger, precedence is flag > error > mutation > ignored_error. Per-guardrail detail stays on the Guardrail child spans.
  • Each guardrail appears once in tfy.triggered_guardrail_fqns. A guardrail that triggers on both input and output is deduplicated, keeping its most severe outcome.
  • The roll-up does not extend to other request types. Endpoints such as /v1/messages, /v1/responses, embeddings, and rerank still run guardrails and still record Guardrail child spans, but emit no request-span roll-up. Query the child spans for those.
The child Model span does not carry these attributes either. For a /chat/completions request the roll-up lives on the ChatCompletion root span, not on the Model: <model> span beneath it.

Guardrail Applied Entity Attributes

Guardrail Metrics

HTTP Response Attributes

GenAI attributes

The gateway can also dual-write OpenTelemetry GenAI semantic convention attributes (gen_ai.*). See GenAI span attributes for enabling the feature, the full attribute mapping, content/privacy behavior, and current limitations.

References