Skip to content
Pyrula
Pre-release: the packages are not on PyPI yet, so pip install does not resolve. Build from source to try it today.

Observe-only frameworks

Pyrula has no adapter for LlamaIndex or CrewAI, so their calls are not journaled and cannot be replayed, paused or cancelled by Pyrula. If you already trace them with OpenTelemetry you can still see their runs, tokens and cost in Pyrula Cloud: the Cloud intake reads GenAI spans over OTLP/HTTP. This is observe-only.

Observe-only (this page)Adapter-backed
Journaled, replayable, resumableNoYes, inside a Pyrula run
What Cloud showsA run per trace, a step per model, tool and agent span, tokens, costThe run’s full event stream
Cancel, terminate, answering a pauseDisabled on imported runsAvailable
Prompt and completion textNever importedSee What leaves your runtime
Code changeA tracer provider and an instrumentorAn import or a wrapper

For comparison, the adapter-backed paths are LangGraph, LangChain chat models, Pydantic AI and the provider drop-ins on LLM providers. The guarantee matrix states what each guarantees.

The environment variables are the ones on Send existing traces: the endpoint, http/protobuf, your project key as a bearer header, and deployment.environment. Set a stable service.name; Cloud groups runs by it.

OpenInference (LlamaIndex, CrewAI and others)

Section titled “OpenInference (LlamaIndex, CrewAI and others)”

OpenInference publishes instrumentors for LlamaIndex, CrewAI, LangChain and others. Install the one for your framework and add a span processor that exports to Cloud. Cloud reads openinference.span.kind (LLM, EMBEDDING, TOOL, AGENT), llm.model_name, llm.token_count.*, tool.name and agent.name; CHAIN, RETRIEVER, RERANKER, GUARDRAIL and EVALUATOR spans are dropped.

# pip install openinference-instrumentation-llama-index opentelemetry-sdk \
# opentelemetry-exporter-otlp-proto-http
from openinference.instrumentation.llama_index import LlamaIndexInstrumentor
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
provider = TracerProvider()
provider.add_span_processor(BatchSpanProcessor(OTLPSpanExporter())) # reads the OTEL_* variables
LlamaIndexInstrumentor().instrument(tracer_provider=provider)

For CrewAI, install openinference-instrumentation-crewai and use CrewAIInstrumentor the same way. The exporter half is the same for every framework, and it is the half that runs here:

import os
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
os.environ.setdefault("OTEL_EXPORTER_OTLP_ENDPOINT", "https://api.pyrula.io/otel")
os.environ.setdefault("OTEL_EXPORTER_OTLP_PROTOCOL", "http/protobuf")
provider = TracerProvider()
provider.add_span_processor(BatchSpanProcessor(OTLPSpanExporter()))

Nothing here has been run with LlamaIndex or CrewAI installed. The instrumentor names and calls above come from OpenInference, so check its documentation for your framework’s version. OpenInference attaches prompts and completions to spans by default; Cloud does not import them, and OpenInference’s OPENINFERENCE_HIDE_INPUTS and OPENINFERENCE_HIDE_OUTPUTS settings are meant to keep them out of the export; confirm in its documentation.

OpenLLMetry (Traceloop) exports GenAI spans, and Cloud reads its older llm.* and *.prompt_tokens attribute spellings as well as the standard gen_ai.* ones. Point its OTLP exporter at the endpoint above with the same variables. Anything else that emits GenAI spans over OTLP/HTTP takes the same route.

An app that already reports through a Pyrula runtime does not need this: the runtime’s connector reports its runs with replay included, and importing the same work as traces would count it twice toward runs per month. Traces that carry a Pyrula run id are skipped for that reason.

View this page as Markdown