LlamaIndex
LlamaIndex is a Python framework for building agents and retrieval-augmented (RAG) applications over your data — FunctionAgent, AgentWorkflow, query engines and custom Workflows. Neens ingests its traces through standard OpenTelemetry with zero Neens-specific code — you instrument LlamaIndex once at startup and point an OTLP exporter at Neens.
At a glance
| Language | Python |
| Instrumentation | openinference-instrumentation-llama-index (OpenInference LlamaIndex instrumentor — community-maintained by Arize) |
| Endpoint | POST /v1/traces (OTLP/HTTP) |
| Auth | Authorization: Bearer nk_live_… agent key |
Instrument your agent
Install the instrumentation
The OpenInference instrumentor hooks LlamaIndex’s own instrumentation layer, so it covers agents, workflows, retrievers, LLM calls and tools without per-provider packages. LlamaIndex 0.12.3 and later needs instrumentor version 4.0 or later.
pip install openinference-instrumentation-llama-index opentelemetry-sdk opentelemetry-exporter-otlpThis assumes you already have LlamaIndex itself installed (pip install llama-index).
Point the exporter at Neens
from openinference.instrumentation.llama_index import LlamaIndexInstrumentor
from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
exporter = OTLPSpanExporter(
endpoint="https://<your-neens-host>/v1/traces",
headers={"Authorization": "Bearer nk_live_your_key_here"},
)
provider = TracerProvider()
provider.add_span_processor(BatchSpanProcessor(exporter))
trace.set_tracer_provider(provider)
# Instrument once, before you build your agents, indexes or query engines.
LlamaIndexInstrumentor().instrument(tracer_provider=provider)Run your agent
Run your agent as usual — for example await agent.run("…") on a FunctionAgent or AgentWorkflow, or query_engine.query("…"). Spans export to Neens in the background.
What Neens captures
The instrumentor emits spans for each agent and workflow step, every LLM call (model, token counts, prompt/response messages), every tool call, and every retrieval (the query and the retrieved documents) — so you see the full agent trajectory, including what context the model was given. For multi-turn agents, set a conversation/session id on your runs so Neens groups them into one session (see Traces & sessions).
Neens speaks standard OTLP — this is not a Neens SDK fork. Any OpenTelemetry-instrumented LlamaIndex app exports to Neens by pointing its exporter at the endpoint above. See Send traces for the full attribute reference, size limits, and response codes.
Verify
Open Traces in Neens; your LlamaIndex runs appear within a few seconds. Continue to Traces & sessions.