Skip to main content
Standardizing span attributes across various models, frameworks, and vendors When sending traces, you might want to define custom attributes for each span. Semantic conventions are specific attribute keys or values that hold special significance. In Future AGI, certain attribute keys are highlighted more prominently, in addition to showing up in the attributes tab like other keys.

Types of Attributes

  • Span
  • Message
  • Document
  • Reranker
  • Embedding
  • Tool Call
For comprehensive guides to semantic conventions, refer to the following resources:
  • Python: See the Python examples above for implementation details
  • TypeScript: See the TypeScript examples above for implementation details

Attribute Overview

Using Semantic Conventions

Here are examples of how to implement semantic conventions in both Python and TypeScript:

Converting Messages to OpenTelemetry Span Attributes

To export a list of objects as OpenTelemetry span attributes, flatten the list until the attribute values are simple types, such as bool, str, bytes, int, float, or simple lists like List[bool], List[str], List[bytes], List[int], List[float].