What are Instrumentations?
Glass is built on OpenTelemetry, the industry-standard for observability. OpenTelemetry uses instrumentations to automatically capture traces from libraries and frameworks — without you changing any code. When you callinit(), Glass automatically instruments your AI providers. Every API call is traced with request/response data, token usage, latency, and errors.
Default Instrumentations
Glass automatically instruments these AI providers out of the box:| Provider | Package | What’s Traced |
|---|---|---|
| OpenAI | openai | Chat completions, embeddings, images, audio |
| Anthropic | anthropic | Messages, completions |
| Google Generative AI | google-generativeai | Gemini generate, chat, embeddings |
Default instrumentations are enabled automatically. No configuration needed.
- Request and response payloads
- Token usage (input/output/total)
- Model name and parameters
- Latency
- Errors and exceptions
Adding Custom Instrumentations
Need to trace other libraries? You can add any OpenTelemetry-compatible instrumentation.Example: Adding HTTP Request Tracing
requests library calls are traced alongside your AI calls.
Example: Multiple Custom Instrumentations
Disabling Default Instrumentations
If you want full control over what gets instrumented, disable the defaults:Popular GenAI Instrumentations
Here are commonly used instrumentations for AI/ML workflows:| Library | Instrumentation Package | Install |
|---|---|---|
| LangChain | opentelemetry-instrumentation-langchain | pip install opentelemetry-instrumentation-langchain |
| LlamaIndex | opentelemetry-instrumentation-llamaindex | pip install opentelemetry-instrumentation-llamaindex |
| Cohere | opentelemetry-instrumentation-cohere | pip install opentelemetry-instrumentation-cohere |
| Bedrock | opentelemetry-instrumentation-bedrock | pip install opentelemetry-instrumentation-bedrock |
| Replicate | opentelemetry-instrumentation-replicate | pip install opentelemetry-instrumentation-replicate |
| Pinecone | opentelemetry-instrumentation-pinecone | pip install opentelemetry-instrumentation-pinecone |
| Chroma | opentelemetry-instrumentation-chromadb | pip install opentelemetry-instrumentation-chromadb |
| Weaviate | opentelemetry-instrumentation-weaviate | pip install opentelemetry-instrumentation-weaviate |
| Qdrant | opentelemetry-instrumentation-qdrant | pip install opentelemetry-instrumentation-qdrant |
OpenTelemetry Registry
Browse all available Python instrumentations in the OpenTelemetry Registry.

