skillfed

opentelemetry-instrumentation-sklearn

OpenTelemetry sklearn instrumentation

opentelemetry-instrumentation-sklearn v0.46b0 171.2K downloads/30d#10,376 on PyPI1,086
Permissive license Active released

What it is and what it does

This package integrates scikit-learn with OpenTelemetry's distributed tracing system. When installed and activated, it automatically wraps scikit-learn operations to emit trace spans, allowing you to observe model training, inference, and other ML workflows as part of a broader observability stack. It depends on opentelemetry-api and opentelemetry-instrumentation to function.

The instrumentation is designed for developers building ML systems who need visibility into scikit-learn's execution within distributed or complex applications. It is currently in beta status and supports Python 3.8 through 3.11. The package has been actively maintained and carries no known security vulnerabilities.

Use it for:

  • Trace scikit-learn model training and prediction calls in microservice architectures to correlate ML operations with other service spans.
  • Monitor performance and latency of scikit-learn operations in production ML pipelines using a centralized observability backend.
  • Debug and profile scikit-learn workflows by examining detailed trace data alongside application logs and metrics.
  • Integrate scikit-learn observability into existing OpenTelemetry-instrumented applications without modifying model code.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Adds distributed tracing instrumentation to scikit-learn operations, capturing them as spans in OpenTelemetry.

Yes, if you are already using OpenTelemetry in your application and need visibility into scikit-learn operations. The low install friction, active maintenance, permissive license, and zero known vulnerabilities make it a safe addition. Beta status means the API may change. Install only if you have an OpenTelemetry tracer/exporter already configured to receive spans.

Install

opentelemetry-instrumentation-sklearn on PyPI

pip

pip install opentelemetry-instrumentation-sklearn

uv

uv add opentelemetry-instrumentation-sklearn

poetry

poetry add opentelemetry-instrumentation-sklearn

Installing opentelemetry-instrumentation-sklearn

Before you install

Low install friction with only two runtime dependencies. Actively maintained with recent commits; still in beta status.

License in practice

Licensed under Apache Software License (permissive), imposing no significant restrictions on use or redistribution.

Quickstart

pip install opentelemetry-instrumentation-sklearn

from opentelemetry.instrumentation.sklearn import SklearnInstrumentor

SklearnInstrumentor().instrument()

Requires Python 3.8 or later; requires an active OpenTelemetry tracer/exporter configured separately to capture and export spans.

Verify before relying

  • Which specific scikit-learn operations are instrumented (fit, predict, transform, etc.)
  • Whether instrumentation works with scikit-learn pipelines and composite estimators
  • Performance overhead of tracing during model training or inference

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 2 — opentelemetry-api, opentelemetry-instrumentation
Maintenance actively maintained — 805 days since the last release
Last repo commit
First released
Downloads 171,235/month — #10,376 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: opentelemetry_instrumentation_sklearn-0.46b0-py3-none-any.whl

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

scikit-learn tracingopentelemetry sklearn instrumentationdistributed tracing machine learningsklearn observabilityml model span capture
observabilitymachine-learningtracing

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-django

Adds distributed tracing to Django applications…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation-boto

Adds distributed tracing to AWS SDK (Boto)…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-structlog

Integrates structlog logging with OpenTelemetry…

permissive · top 15,000 on PyPI

opentelemetry-instrumentation-click

Adds distributed tracing instrumentation to the…

permissive · top 5,000 on PyPI

otel-extensions

Provides helper classes, decorators, and…

permissive · top 15,000 on PyPI

opentelemetry-instrumentation-kafka-python

Adds distributed tracing instrumentation to…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-redis

Adds distributed tracing to Redis client calls…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation-elasticsearch

Adds distributed tracing to Elasticsearch…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-aiokafka

Adds distributed tracing instrumentation to…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-celery

Adds distributed tracing and observability to…

permissive · top 5,000 on PyPI