openinference-instrumentation-openlit span processor converts OpenLIT’s spans to OpenInference semantic conventions, so they display in Phoenix with span kinds, inputs, outputs, and token counts.
Install
This example traces a LangGraph agent that calls OpenAI:Setup
Set your API keys as environment variables:Processor ordering matters.
register() installs a default exporter-backed processor. Adding OpenInferenceSpanProcessor() replaces that default, and the BatchSpanProcessor you add after it exports the converted spans to Phoenix.Run OpenLIT
This email composer agent has three LangGraph nodes, each backed by an OpenAI call: generate an outline, write the email, and rewrite it if it doesn’t match the requested tone.Observe
Open theopenlit project in Phoenix. Each OpenAI call that OpenLIT captures appears as an LLM span with the prompt, response, model name, and token usage, converted to OpenInference by the span processor.

