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: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: Instrumenting Ollama
For local models served via Ollama, use the Ollama instrumentation:pip install opentelemetry-instrumentation-ollama.
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:OpenTelemetry Registry
Browse all available Python instrumentations in the OpenTelemetry Registry.

