open-telemetry / open-telemetry/opentelemetry-python-contrib

`opentelemetry-bootstrap --action=requirements` should respect `OTEL_PYTHON_DISABLED_INSTRUMENTATIONS`

Open
#4,647 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request
Dominant language
Python
Stars
1.1k
Forks
1.1k
Avg merge
4d 15h
Merged PRs (30d)
16

Description

What problem do you want to solve?

When building Docker images, we use opentelemetry-bootstrap --action=requirements to generate the list of instrumentor packages to install. However, this command outputs all instrumentors matching installed libraries, even those we explicitly disable at runtime via OTEL_PYTHON_DISABLED_INSTRUMENTATIONS.

This means we install packages we will never use, increasing image size and build time unnecessarily.

Example Dockerfile pattern:

ENV OTEL_PYTHON_DISABLED_INSTRUMENTATIONS="psycopg,system_metrics"

# This still outputs opentelemetry-instrumentation-psycopg and opentelemetry-instrumentation-system-metrics
RUN opentelemetry-bootstrap --action=requirements | pip install -r /dev/stdin
Describe the solution you'd like

opentelemetry-bootstrap should support filtering out disabled instrumentations:

Read OTEL_PYTHON_DISABLED_INSTRUMENTATIONS env var — if set, exclude matching instrumentors from the output. This aligns with the existing runtime behavior.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the opentelemetry-bootstrap entry point and trace the requirements action, then compare how runtime behavior reads OTEL_PYTHON_DISABLED_INSTRUMENTATIONS. Done when disabled instrumentors are excluded from the generated requirements output and coverage verifies the Dockerfile example behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, observability
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.