Spans Best Practices
Best practices for creating effective spans in your AI applications
Follow these best practices to create meaningful, well-structured spans that provide clear insights into your operations.
🎯 Span Naming
Clear and Descriptive Names
Use Action-Oriented Names
📊 Attribute Naming
Consistent Naming Conventions
Hierarchical Naming
🎪 Event Timing
Add Events at Meaningful Points
State Change Events
🛡️ Error Handling
Comprehensive Error Tracking
Error Context and Recovery
🔗 Parent-Child Relationships
Logical Hierarchy
Context Inheritance
📈 Performance Optimization
Minimize Attribute Overhead
Use Conditional Attributes
🎯 AI-Specific Best Practices
LLM Span Attributes
Agent Span Context
Tool Execution Spans
🔍 Debugging Support
Include Debug Information
Trace Correlation
🎪 Event Patterns
Start/Complete Pattern
Retry Pattern
🚀 Next Steps
Now that you understand span best practices, explore these related concepts:
- Traces Best Practices - Best practices for complete request journeys
- Attributes Best Practices - Best practices for metadata and context
- Events Best Practices - Best practices for point-in-time occurrences
Well-structured spans are the building blocks of observability. By following these best practices, you'll create spans that provide clear insights into your operations.
Exclusive Early Access
Get Early Access to Noveum.ai Platform
Be the first one to get notified when we open Noveum Platform to more users. All users get access to Observability suite for free, early users get free eval jobs and premium support for the first year.