Spans
A span represents a unit of work or operation (think aspan of time). It tracks specific operations that a request makes, painting a picture of what happened during the time in which that operation was executed.
A span contains name, time-related data, structured log messages, and other metadata (that is, Attributes) to provide information about the operation it tracks. A span for an LLM execution in JSON format is displayed below
Traces
A trace records the paths taken by requests (made by an application or end-user) as they propagate through multiple steps. Without tracing, it is challenging to pinpoint the cause of performance problems in a system. It improves the visibility of our application or system’s health and lets us debug behavior that is difficult to reproduce locally. Tracing is essential for LLM applications, which commonly have nondeterministic problems or are too complicated to reproduce locally. Tracing makes debugging and understanding LLM applications less daunting by breaking down what happens within a request as it flows through a system. A trace is made of one or more spans. The first span represents the root span. Each root span represents a request from start to finish. The spans underneath the parent provide a more in-depth context of what occurs during a request (or what steps make up a request).Projects
Aproject is a collection of traces. You can think of a project as a container for all the traces that are related to a single application or service. You can have multiple projects, and each project can have multiple traces. Projects can be useful for various use-cases such as separating out environments, logging traces for evaluation runs, etc. To learn more about how to setup projects, see the how-to guide
Span Kind
When a span is created, it is created as one of the following: Chain, Retriever, Reranker, LLM, Embedding, Agent, or Tool.
The SpanKinds supported by OpenInference Tracing
Span Attributes
Attributes are key-value pairs that contain metadata that you can use to annotate a span to carry information about the operation it is tracking. For example, if a span invokes an LLM, you can capture the model name, the invocation parameters, the token count, and so on. Attributes have the following rules:- Keys must be non-null string values
- Values must be a non-null string, boolean, floating point value, integer, or an array of these values Additionally, there are Semantic Attributes, which are known naming conventions for metadata that is typically present in common operations. It’s helpful to use semantic attribute naming wherever possible so that common kinds of metadata are standardized across systems. See semantic conventions for more information.

