skillfed

opentelemetry-instrumentation-click

Click instrumentation for OpenTelemetry

opentelemetry-instrumentation-click v0.65b0 1.3M downloads/30d#4,024 on PyPI1,086
Permissive license Apache-2.0 Active released

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

uv

uv add opentelemetry-instrumentation-click

poetry

poetry add opentelemetry-instrumentation-click

Installing 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

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.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

click CLI tracingopentelemetry click instrumentationdistributed tracing CLI commandsclick command observabilityopentelemetry instrumentationCLI span capture
observabilitycli-instrumentationtracing

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

Adds OpenTelemetry tracing to asyncclick CLI…

permissive · top 15,000 on PyPI

opentelemetry-instrumentation-remoulade

Adds distributed tracing instrumentation for…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-celery

Adds distributed tracing and observability to…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-sklearn

Adds distributed tracing instrumentation to…

permissive · top 15,000 on PyPI

opentelemetry-instrumentation-redis

Adds distributed tracing to Redis client calls…

permissive · top 1,000 on PyPI

otel-ci

Records and exports OpenTelemetry spans from…

unclear · top 15,000 on PyPI

opentelemetry-instrumentation-aiokafka

Adds distributed tracing instrumentation to…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-pymemcache

Adds OpenTelemetry tracing instrumentation to…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-sqlalchemy

Adds distributed tracing to SQLAlchemy database…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation-ollama

Adds distributed tracing to Ollama Python…

permissive · top 5,000 on PyPI