--- id: opentelemetry-instrumentation-sklearn version: "0.46b0" license: unclear license_treatment: permissive maintenance: active --- # opentelemetry-instrumentation-sklearn — OpenTelemetry sklearn instrumentation License: permissive · Maintenance: active · Downloads: 171.2K/mo ## 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 above — 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 pip install opentelemetry-instrumentation-sklearn uv add opentelemetry-instrumentation-sklearn 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_current - Install friction: low - Maintenance: active - Downloads: 171.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags scikit-learn tracing, opentelemetry sklearn instrumentation, distributed tracing machine learning, sklearn observability, ml model span capture, observability, machine-learning, tracing [View on SkillFed](https://skillfed.io/packages/opentelemetry-instrumentation-sklearn) · [View on PyPI](https://pypi.org/project/opentelemetry-instrumentation-sklearn/)