opentelemetry-instrumentation-click
Click instrumentation for OpenTelemetry
What it is and what it does
This package integrates OpenTelemetry tracing into click-based command-line applications. It automatically wraps click command execution to emit spans, allowing you to observe CLI tool behavior within distributed tracing systems. The instrumentation works by hooking into click's execution layer through wrapt, capturing command invocations as trace events that flow into your OpenTelemetry collector.
It's designed for developers building CLI tools who want observability alongside their backend services. You install it alongside click and the core OpenTelemetry libraries, and it activates automatically when your CLI runs, requiring no changes to your click command definitions. The package is in beta status and supports Python 3.10 through 3.14.
Use it for:
- Trace CLI tool execution in microservice environments to correlate command runs with backend operations
- Monitor long-running batch jobs triggered by click commands for performance analysis
- Debug click command failures by examining trace spans and context propagation
- Observe CLI tool usage patterns and execution times across distributed systems
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds distributed tracing instrumentation to the click CLI library, automatically capturing command execution as spans in OpenTelemetry traces.
Yes, if you use click for CLI tools and already run OpenTelemetry in your infrastructure. The package is actively maintained, has no known vulnerabilities, and low install friction. The beta status (0.65b0) is typical for OpenTelemetry instrumentation packages and should not deter adoption if your observability setup is already in place.
Install
opentelemetry-instrumentation-click on PyPI
pip
pip install opentelemetry-instrumentation-clickuv
uv add opentelemetry-instrumentation-clickpoetry
poetry add opentelemetry-instrumentation-clickInstalling opentelemetry-instrumentation-click
Before you install
Low friction install with four stable runtime dependencies. Actively maintained as of 29 days ago with recent commit activity.
License in practice
Apache-2.0 permissive license allows commercial use, modification, and distribution with minimal restrictions.
Quickstart
pip install opentelemetry-instrumentation-click
from opentelemetry.instrumentation.click import ClickInstrumentor
ClickInstrumentor().instrument()
Requires Python 3.10 or later; click library must be installed separately
Verify before relying
- Whether this package works with click versions prior to the package's first release date (2024-12-11)
- Specific click version compatibility range not stated in fact sheet
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — opentelemetry-api, opentelemetry-instrumentation, opentelemetry-semantic-conventions, wrapt |
| Maintenance | actively maintained — 29 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,345,008/month — #4,024 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: opentelemetry_instrumentation_click-0.65b0-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-asyncclickAdds OpenTelemetry tracing to asyncclick CLI…
permissive · top 15,000 on PyPI
opentelemetry-instrumentation-remouladeAdds distributed tracing instrumentation for…
permissive · top 5,000 on PyPI
opentelemetry-instrumentation-celeryAdds distributed tracing and observability to…
permissive · top 5,000 on PyPI
opentelemetry-instrumentation-sklearnAdds distributed tracing instrumentation to…
permissive · top 15,000 on PyPI
opentelemetry-instrumentation-redisAdds distributed tracing to Redis client calls…
permissive · top 1,000 on PyPI
otel-ciRecords and exports OpenTelemetry spans from…
unclear · top 15,000 on PyPI
opentelemetry-instrumentation-aiokafkaAdds distributed tracing instrumentation to…
permissive · top 5,000 on PyPI
opentelemetry-instrumentation-pymemcacheAdds OpenTelemetry tracing instrumentation to…
permissive · top 5,000 on PyPI
opentelemetry-instrumentation-sqlalchemyAdds distributed tracing to SQLAlchemy database…
permissive · top 1,000 on PyPI
opentelemetry-instrumentation-ollamaAdds distributed tracing to Ollama Python…
permissive · top 5,000 on PyPI