Skip to content

Latest commit

 

History

History

README.rst

OpenTelemetry LlamaIndex Instrumentation

pypi

This package contains the OpenTelemetry instrumentor scaffold for LlamaIndex.

Installation

pip install opentelemetry-instrumentation-genai-llama-index

Usage

from opentelemetry.instrumentation.genai.llama_index import (
    LlamaIndexInstrumentor,
)

LlamaIndexInstrumentor().instrument()

Configuration

Content capture is controlled through the OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT environment variable. Supported values are NO_CONTENT, SPAN_ONLY, EVENT_ONLY, and SPAN_AND_EVENT.

Prompts and completions can also be redirected via a completion hook by setting OTEL_INSTRUMENTATION_GENAI_COMPLETION_HOOK or by passing instrument(completion_hook=...).

References