Logging
Logging with Galileo involves several core concepts. These make it easier to identify problems or ways to improve your pipeline.
Spans
A span is the atomic unit of logging in Galileo. Each represents a discrete operation or step within your AI application.
Spans can have several different types:
llm
- when a span invokes an LLM call.retriever
- when a span is retrieving data.tool
- when a span makes agentic tool calls.workflow
- when a span contains multiple sub-spans.
Spans record detailed information about these operations, including inputs, outputs, duration, relevant metadata, and their relationships to each other. Spans are organized hierarchically within traces.
Traces
A trace is a collection of related spans that, together, represent a single logical response.
Traces help you understand how a response was generated across multiple steps, and are especially useful when debugging multi-step LLM workflows. This organization facilitates end-to-end visibility, workflow reconstruction, performance analysis, error diagnosis, and quality assessment.
To more efficiently analyze and manage traces across different contexts, they are organized into log streams.
Log Streams
Log streams are organizational units that group related traces together based on logical deployments, applications, or environments.
Log streams provide a structured way to categorize and manage traces across your AI workflows, making it easier to monitor, analyze, and debug specific segments of your application ecosystem. By organizing traces into log streams, you can separate data from different environments (development
, staging
, production
), isolate traces from various applications or services, and group traces by feature, team, or business unit.
All log streams are organized and managed within projects.
Projects
Projects serve as the top-level organizational units that encapsulate all log streams related to your AI applications.
Projects provide a structured environment where you can manage and coordinate log streams, ensuring that related streams are grouped together. This allows for effective user management, where different access levels can be assigned to team members, such as viewers
, editors
, and admins
.
Programmatic management and interaction with log streams within a project is accomplished using the Galileo Logger.
Galileo Logger
The Galileo Logger is the SDK interface used to create and manage spans, traces, log streams and projects.
As your application runs, the Galileo Logger streams logs back to Galileo as spans, which are collected into traces. These traces get analyzed using the Metrics you set up, and related traces are organized into log streams. Traces that seem problematic can then be reviewed step by step within projects to determine what part of the pipeline needs changing, or if the Metrics need tweaking.
You can access the Galileo Logger directly using the Python SDK or TypeScript SDK.
Learn about logging in Python
Learn how to use the Galileo SDK to log data from your application.
Learn about logging in TypeScript
Learn how to use the Galileo SDK to log data from your application.