--- id: opentelemetry-instrumentation-ollama version: "0.62.3" license: Apache-2.0 license_treatment: permissive maintenance: active --- # opentelemetry-instrumentation-ollama — OpenTelemetry Ollama instrumentation License: permissive · Maintenance: active · Downloads: 6.9M/mo ## What it is and what it does This package wraps the Ollama Python client to emit OpenTelemetry spans for every call to Ollama's endpoints. It integrates with your existing OpenTelemetry setup (API, instrumentation base, and semantic conventions) to capture request and response details as structured trace data. By default, it logs prompts, completions, and embeddings to span attributes for full visibility into LLM behavior; you can disable this via the TRACELOOP_TRACE_CONTENT environment variable if the data contains sensitive information or you want smaller traces. The instrumentation is designed for developers building LLM applications who need observability into Ollama calls without modifying their application code. It follows the OpenTelemetry semantic conventions for AI systems, making traces compatible with standard observability platforms and tools. Use it for: - Debug LLM application behavior by inspecting prompts, completions, and response latencies in distributed traces. - Monitor Ollama endpoint performance and error rates across your infrastructure using OpenTelemetry exporters. - Audit LLM interactions for compliance or quality assurance by capturing full request/response data in traces. - Correlate Ollama calls with upstream application logic using trace context propagation. - Reduce trace size and remove sensitive data by disabling content logging in production deployments. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Adds distributed tracing to Ollama Python client calls, capturing request and response data as OpenTelemetry spans for observability and debugging. Yes, if you are already using OpenTelemetry in your application and need visibility into Ollama calls. The package is actively maintained, has no known vulnerabilities, and integrates cleanly with standard observability stacks. Install it only if you have an OpenTelemetry SDK and exporter configured; it is not a standalone observability solution. ## Install pip install opentelemetry-instrumentation-ollama uv add opentelemetry-instrumentation-ollama poetry add opentelemetry-instrumentation-ollama ## Installing opentelemetry-instrumentation-ollama Before you install: Low friction: pure Python wheel with four stable OpenTelemetry dependencies. Actively maintained with a recent release (4 days old) and no known vulnerabilities. License in practice: Apache-2.0 permissive license allows use in most commercial and open-source projects without significant restrictions. Quickstart: pip install opentelemetry-instrumentation-ollama from opentelemetry.instrumentation.ollama import OllamaInstrumentor OllamaInstrumentor().instrument() Requires Python 3.10 or later; assumes an OpenTelemetry SDK and exporter are already configured in your application. Verify before relying: - Whether the instrumentation works with all Ollama endpoint types or only a subset. - Performance overhead of tracing on typical Ollama workloads. - How the TRACELOOP_TRACE_CONTENT environment variable interacts with other trace filtering mechanisms. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 6.9M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags ollama tracing instrumentation, opentelemetry ollama integration, llm call tracing, distributed tracing for ollama, ollama observability, span instrumentation for llm, ollama debugging traces, observability, llm-tracing, instrumentation [View on SkillFed](https://skillfed.io/packages/opentelemetry-instrumentation-ollama) · [View on PyPI](https://pypi.org/project/opentelemetry-instrumentation-ollama/)