Building Blocks of Traces in Galileo
Spans in Galileo are the fundamental building blocks of traces, representing discrete operations or units of work within your AI application. A span captures a single step in your application’s workflow, such as an LLM call, a document retrieval operation, a tool execution, or any other distinct process.
Each span records detailed information about a specific operation, including its inputs, outputs, duration, and any relevant metadata. Spans are organized hierarchically within traces, allowing you to understand both individual operations and their relationships to each other.
Spans serve several critical roles in the Galileo platform:
Granular Representation: Spans break down complex workflows into discrete, manageable units, making it easier to understand and analyze each step.
Contextual Information: Each span contains rich contextual information about the operation it represents, including inputs, outputs, and configuration details.
Hierarchical Organization: Spans can be nested within other spans, creating a hierarchical structure that reflects the organization of your application’s workflows.
Performance Tracking: Spans capture timing information, allowing you to identify bottlenecks and optimize performance.
Error Isolation: When issues occur, spans help isolate the specific operation where the error originated.
Spans are essential for detailed system evaluation and debugging for several reasons:
Pinpoint Precision: Spans allow you to pinpoint exactly where in a workflow issues are occurring, rather than just knowing that something went wrong.
Input-Output Analysis: By examining the inputs and outputs of each span, you can identify where unexpected results are being generated.
Performance Profiling: Span durations help you identify which operations are taking the most time, guiding optimization efforts.
Error Context: When errors occur, spans provide the context needed to understand what led to the error and how to fix it.
Quality Assessment: Spans enable evaluation of individual components of your system, helping you identify which parts are performing well and which need improvement.
A span in Galileo consists of several core components:
llm
, workflow
, retriever
, tool
)Galileo supports several types of spans, each designed to capture different kinds of operations:
LLM Spans: Capture interactions with language models, including:
Workflow Spans: Represent logical groupings of operations that can contain child spans, useful for:
Retriever Spans: Record document retrieval operations, including:
Tool Spans: Document tool calls in agent-based systems, including:
Each span type has specific fields and behaviors tailored to the operation it represents, allowing for more detailed and relevant information capture.
Metadata enhances the traceability and utility of spans in several ways:
Contextual Information: Metadata provides additional context about the operation, such as user IDs, session information, or application-specific data.
Filtering and Searching: Metadata can be used to filter and search for specific spans, making it easier to find relevant information.
Correlation: Metadata helps correlate spans across different traces or systems, enabling end-to-end visibility.
Custom Attributes: You can add custom attributes to metadata to capture information specific to your application or use case.
Debugging Context: In debugging scenarios, metadata can provide crucial context about the state of your application when the operation occurred.
Galileo provides several methods for creating and managing spans, each offering different levels of control and convenience.
When creating spans, you need to provide:
llm
, workflow
, retriever
, or tool
)workflow
and tool
spans): A descriptive name for the operationAdditional optional configurations include:
llm
spans): Details about the model usedSpans can be customized in several ways:
Spans in Galileo are valuable for a wide range of use cases:
LLM Interaction Tracking: Capture details of interactions with language models, including prompts, responses, and model configurations.
RAG Pipeline Analysis: Track each step in a retrieval-augmented generation pipeline, from document retrieval to LLM generation.
Agent Workflow Monitoring: Monitor the actions of AI agents, including tool calls and decision-making processes.
Performance Profiling: Identify bottlenecks and optimization opportunities by analyzing span durations.
Error Diagnosis: When issues occur, examine spans to understand what went wrong and why.
Quality Assessment: Evaluate the quality of individual components in your AI system.
Spans can represent various parts of a workflow:
By combining these span types, you can create a complete representation of your application’s workflows, from simple LLM calls to complex multi-step processes.
When working with spans, follow these best practices:
Meaningful Names: Use descriptive names for spans to make them easier to understand and analyze.
Appropriate Granularity: Create spans at an appropriate level of granularity - too fine-grained and you’ll have too many spans to manage, too coarse-grained and you’ll miss important details.
Include Relevant Metadata: Add metadata that will be useful for filtering, analysis, and debugging.
Proper Hierarchy: Organize spans in a logical hierarchy that reflects the structure of your application’s workflows.
Error Handling: Log errors in spans to help with debugging and analysis.
Complete Spans: Always conclude spans to ensure they have both input and output information.
Consistent Naming: Use consistent naming conventions for similar spans across your application.
Spans integrate seamlessly with other Galileo components:
Logs: Spans contain log data, providing structure and context for individual log entries.
Traces: Spans are organized into traces, which represent complete interactions or workflows.
Metrics: Span data feeds into metrics, allowing you to measure and monitor key aspects of your AI application.
Experiments: Spans can be used in experiments to compare different models, prompts, or configurations.
Datasets: Spans can be converted into datasets for fine-tuning or evaluation.
Alerts: Patterns in spans can trigger alerts to notify you of issues or anomalies.
The typical data flow for spans in Galileo is:
Spans have dependencies on several Galileo components:
After understanding spans, you can explore these related Galileo features:
Building Blocks of Traces in Galileo
Spans in Galileo are the fundamental building blocks of traces, representing discrete operations or units of work within your AI application. A span captures a single step in your application’s workflow, such as an LLM call, a document retrieval operation, a tool execution, or any other distinct process.
Each span records detailed information about a specific operation, including its inputs, outputs, duration, and any relevant metadata. Spans are organized hierarchically within traces, allowing you to understand both individual operations and their relationships to each other.
Spans serve several critical roles in the Galileo platform:
Granular Representation: Spans break down complex workflows into discrete, manageable units, making it easier to understand and analyze each step.
Contextual Information: Each span contains rich contextual information about the operation it represents, including inputs, outputs, and configuration details.
Hierarchical Organization: Spans can be nested within other spans, creating a hierarchical structure that reflects the organization of your application’s workflows.
Performance Tracking: Spans capture timing information, allowing you to identify bottlenecks and optimize performance.
Error Isolation: When issues occur, spans help isolate the specific operation where the error originated.
Spans are essential for detailed system evaluation and debugging for several reasons:
Pinpoint Precision: Spans allow you to pinpoint exactly where in a workflow issues are occurring, rather than just knowing that something went wrong.
Input-Output Analysis: By examining the inputs and outputs of each span, you can identify where unexpected results are being generated.
Performance Profiling: Span durations help you identify which operations are taking the most time, guiding optimization efforts.
Error Context: When errors occur, spans provide the context needed to understand what led to the error and how to fix it.
Quality Assessment: Spans enable evaluation of individual components of your system, helping you identify which parts are performing well and which need improvement.
A span in Galileo consists of several core components:
llm
, workflow
, retriever
, tool
)Galileo supports several types of spans, each designed to capture different kinds of operations:
LLM Spans: Capture interactions with language models, including:
Workflow Spans: Represent logical groupings of operations that can contain child spans, useful for:
Retriever Spans: Record document retrieval operations, including:
Tool Spans: Document tool calls in agent-based systems, including:
Each span type has specific fields and behaviors tailored to the operation it represents, allowing for more detailed and relevant information capture.
Metadata enhances the traceability and utility of spans in several ways:
Contextual Information: Metadata provides additional context about the operation, such as user IDs, session information, or application-specific data.
Filtering and Searching: Metadata can be used to filter and search for specific spans, making it easier to find relevant information.
Correlation: Metadata helps correlate spans across different traces or systems, enabling end-to-end visibility.
Custom Attributes: You can add custom attributes to metadata to capture information specific to your application or use case.
Debugging Context: In debugging scenarios, metadata can provide crucial context about the state of your application when the operation occurred.
Galileo provides several methods for creating and managing spans, each offering different levels of control and convenience.
When creating spans, you need to provide:
llm
, workflow
, retriever
, or tool
)workflow
and tool
spans): A descriptive name for the operationAdditional optional configurations include:
llm
spans): Details about the model usedSpans can be customized in several ways:
Spans in Galileo are valuable for a wide range of use cases:
LLM Interaction Tracking: Capture details of interactions with language models, including prompts, responses, and model configurations.
RAG Pipeline Analysis: Track each step in a retrieval-augmented generation pipeline, from document retrieval to LLM generation.
Agent Workflow Monitoring: Monitor the actions of AI agents, including tool calls and decision-making processes.
Performance Profiling: Identify bottlenecks and optimization opportunities by analyzing span durations.
Error Diagnosis: When issues occur, examine spans to understand what went wrong and why.
Quality Assessment: Evaluate the quality of individual components in your AI system.
Spans can represent various parts of a workflow:
By combining these span types, you can create a complete representation of your application’s workflows, from simple LLM calls to complex multi-step processes.
When working with spans, follow these best practices:
Meaningful Names: Use descriptive names for spans to make them easier to understand and analyze.
Appropriate Granularity: Create spans at an appropriate level of granularity - too fine-grained and you’ll have too many spans to manage, too coarse-grained and you’ll miss important details.
Include Relevant Metadata: Add metadata that will be useful for filtering, analysis, and debugging.
Proper Hierarchy: Organize spans in a logical hierarchy that reflects the structure of your application’s workflows.
Error Handling: Log errors in spans to help with debugging and analysis.
Complete Spans: Always conclude spans to ensure they have both input and output information.
Consistent Naming: Use consistent naming conventions for similar spans across your application.
Spans integrate seamlessly with other Galileo components:
Logs: Spans contain log data, providing structure and context for individual log entries.
Traces: Spans are organized into traces, which represent complete interactions or workflows.
Metrics: Span data feeds into metrics, allowing you to measure and monitor key aspects of your AI application.
Experiments: Spans can be used in experiments to compare different models, prompts, or configurations.
Datasets: Spans can be converted into datasets for fine-tuning or evaluation.
Alerts: Patterns in spans can trigger alerts to notify you of issues or anomalies.
The typical data flow for spans in Galileo is:
Spans have dependencies on several Galileo components:
After understanding spans, you can explore these related Galileo features: