opentelemetry-instrumentation-sklearn
OpenTelemetry sklearn instrumentation
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-sklearnuv
uv add opentelemetry-instrumentation-sklearnpoetry
poetry add opentelemetry-instrumentation-sklearnInstalling 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
Tags
More Monitoring packages
Wraps any iterable to display a real-time…
copyleft · top 100 on PyPI
opentelemetry-semantic-conventionsProvides generated Python code for…
permissive · top 100 on PyPI
opentelemetry-sdkProvides the reference implementation of the…
permissive · top 100 on PyPI
opentelemetry-apiProvides the abstract API and interfaces for…
permissive · top 100 on PyPI
opentelemetry-exporter-otlp-proto-httpExports OpenTelemetry observability data to an…
permissive · top 1,000 on PyPI
opentelemetry-instrumentationProvides automatic instrumentation commands and…
permissive · top 1,000 on PyPI
opentelemetry-instrumentation-djangoAdds distributed tracing to Django applications…
permissive · top 1,000 on PyPI
opentelemetry-instrumentation-botoAdds distributed tracing to AWS SDK (Boto)…
permissive · top 5,000 on PyPI
opentelemetry-instrumentation-structlogIntegrates structlog logging with OpenTelemetry…
permissive · top 15,000 on PyPI
opentelemetry-instrumentation-clickAdds distributed tracing instrumentation to the…
permissive · top 5,000 on PyPI
otel-extensionsProvides helper classes, decorators, and…
permissive · top 15,000 on PyPI
opentelemetry-instrumentation-kafka-pythonAdds distributed tracing instrumentation to…
permissive · top 5,000 on PyPI
opentelemetry-instrumentation-redisAdds distributed tracing to Redis client calls…
permissive · top 1,000 on PyPI
opentelemetry-instrumentation-elasticsearchAdds distributed tracing to Elasticsearch…
permissive · top 5,000 on PyPI
opentelemetry-instrumentation-aiokafkaAdds distributed tracing instrumentation to…
permissive · top 5,000 on PyPI
opentelemetry-instrumentation-celeryAdds distributed tracing and observability to…
permissive · top 5,000 on PyPI