Skip to main content

Initialize

Initialize the SDK. Call this before importing LLM libraries for auto-instrumentation.

Get Model

Get model assignment for a session.

Get Prompt

Get a managed prompt.Returns: PromptResult with key, version, system, user

Get Prompt A/B Test

Get a prompt from an A/B test (sticky assignment).Returns: PromptResult with key, version, system, user, ab_test_key, variant_index

Set Session

Set trace context. All subsequent LLM calls will be tagged with this config_key and session_id.

Clear Session

Clear trace context.

Record Custom Metrics

Record custom business metrics.

Supported LLM Providers

Auto-instrumentation available for:
  • OpenAI (+ OpenAI-compatible APIs: OpenRouter, LiteLLM, vLLM, Ollama, etc.)
  • Anthropic
  • Cohere
  • AWS Bedrock
  • Google Generative AI
  • Mistral AI
  • LangChain
  • Replicate
  • Vertex AI
Install the corresponding opentelemetry-instrumentation-* package for your provider.
You must use the official SDK for your provider. Raw HTTP requests (e.g., requests.post()) will not be traced. For OpenAI-compatible APIs, use the OpenAI SDK with a custom base_url.