Use uv-native approach in python instrumentation docs
What needs to be changed?
I would love for the docs to convey the uv-native way of installing packages:
- replace
uv pip install --requirement -withuv add --requirement -- would also enable users to put otel stuff into dependency groups more easily
- replace
uv pip install opentelemetry-distro opentelemetry-exporter-otlpwith the appropriateuvx/uv tool runtool call- I already did some digging (see additional context) but still the
uvxapproach is missing 4 package dependencies - I just cannot figure out why:
- I already did some digging (see additional context) but still the
opentelemetry-instrumentation-system-metrics==0.59b0
opentelemetry-instrumentation-tortoiseorm==0.59b0
opentelemetry-instrumentation-jinja2==0.59b0
opentelemetry-instrumentation-click==0.59b0
What is the name + path of the page that needs changed? Bootstrap using uv
Additional context:
When running the following as per the docs I get 14 required dependencies as of today:
$ uv run opentelemetry-bootstrap -a requirements
opentelemetry-instrumentation-asyncio==0.59b0
opentelemetry-instrumentation-dbapi==0.59b0
opentelemetry-instrumentation-logging==0.59b0
opentelemetry-instrumentation-sqlite3==0.59b0
opentelemetry-instrumentation-threading==0.59b0
opentelemetry-instrumentation-urllib==0.59b0
opentelemetry-instrumentation-wsgi==0.59b0
opentelemetry-instrumentation-click==0.59b0
opentelemetry-instrumentation-grpc==0.59b0
opentelemetry-instrumentation-jinja2==0.59b0
opentelemetry-instrumentation-requests==0.59b0
opentelemetry-instrumentation-system-metrics==0.59b0
opentelemetry-instrumentation-tortoiseorm==0.59b0
opentelemetry-instrumentation-urllib3==0.59b0
as compared to the more uv-native way:
uvx --from="opentelemetry-instrumentation" opentelemetry-bootstrap -a requirements | uv add --requirement -
where I due to the output of the pre-pipe part of the command, only obtain 7 packages:
opentelemetry-instrumentation-asyncio==0.59b0
opentelemetry-instrumentation-dbapi==0.59b0
opentelemetry-instrumentation-logging==0.59b0
opentelemetry-instrumentation-sqlite3==0.59b0
opentelemetry-instrumentation-threading==0.59b0
opentelemetry-instrumentation-urllib==0.59b0
opentelemetry-instrumentation-wsgi==0.59b0
Adding --with="opentelemetry-exporter-otlp" and --with="opentelemetry-distro" I gain the following packages
opentelemetry-instrumentation-grpc==0.59b0
opentelemetry-instrumentation-requests==0.59b0
opentelemetry-instrumentation-urllib3==0.59b0
Tip:
React
with 👍 to help prioritize this issue. Please use comments to provide useful
context, avoiding +1 or me too, to help us triage it. Learn more
here.
@open-telemetry/python-approvers PTAL
@open-telemetry/python-approvers PTAL!
@JulianDroste opentelemetry-bootstrap scans the current environment for packages we have instrumentation for, if it doesn't list a package it is because it doesn't find it. uv pip install opentelemetry-distro opentelemetry-exporter-otlp should be uv add opentelemetry-distro opentelemetry-exporter-otlp since these will be requirements of the instrumented application.
Using plain uv instead of uvx should be just fine. Said that feel free to open a PR so we can review it.