skillfed

opentelemetry-instrumentation-ollama

OpenTelemetry Ollama instrumentation

opentelemetry-instrumentation-ollama v0.62.3 6.9M downloads/30d#1,825 on PyPI7,377
Permissive license Apache-2.0 Active released

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 on this page — 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

opentelemetry-instrumentation-ollama on PyPI

pip

pip install opentelemetry-instrumentation-ollama

uv

uv add opentelemetry-instrumentation-ollama

poetry

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 the current Python release (<4,>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 4 — opentelemetry-api, opentelemetry-instrumentation, opentelemetry-semantic-conventions-ai, opentelemetry-semantic-conventions
Maintenance actively maintained — 4 days since the last release
Last repo commit
First released
Downloads 6,879,570/month — #1,825 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: opentelemetry_instrumentation_ollama-0.62.3-py3-none-any.whl

Tags

ollama tracing instrumentationopentelemetry ollama integrationllm call tracingdistributed tracing for ollamaollama observabilityspan instrumentation for llmollama debugging traces
observabilityllm-tracinginstrumentation

More Monitoring packages

tqdm

Wraps any iterable to display a real-time…

copyleft · top 100 on PyPI

opentelemetry-semantic-conventions

Provides generated Python code for…

permissive · top 100 on PyPI

opentelemetry-sdk

Provides the reference implementation of the…

permissive · top 100 on PyPI

opentelemetry-api

Provides the abstract API and interfaces for…

permissive · top 100 on PyPI

opentelemetry-exporter-otlp-proto-http

Exports OpenTelemetry observability data to an…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation

Provides automatic instrumentation commands and…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation-langchain

Adds distributed tracing to Langchain LLM…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-llamaindex

Adds distributed tracing to LlamaIndex…

permissive · top 5,000 on PyPI

raindrop-ai

Instrument LLM applications with event tracking…

permissive · top 15,000 on PyPI

llama-index-instrumentation

Provides instrumentation hooks for…

permissive · top 5,000 on PyPI

traceloop-sdk

Traceloop SDK instruments LLM applications to…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-haystack

Adds distributed tracing to Haystack LLM…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-writer

Automatically traces calls to Writer's API…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-alephalpha

Automatically captures and traces calls to…

permissive · top 5,000 on PyPI

lumigo-tracer

Lumigo-tracer instruments Python Lambda…

permissive · top 15,000 on PyPI

opentelemetry-instrumentation-cohere

Automatically traces calls to Cohere's API…

permissive · top 5,000 on PyPI