diff --git a/content/en/docs/zero-code/python/_index.md b/content/en/docs/zero-code/python/_index.md index c9d4887282b1..5413707ca501 100644 --- a/content/en/docs/zero-code/python/_index.md +++ b/content/en/docs/zero-code/python/_index.md @@ -120,3 +120,35 @@ export GRPC_VERBOSITY=debug export GRPC_TRACE=http,call_error,connectivity_state opentelemetry-instrument python YOUR_APP.py ``` + +### Bootstrap using uv + +When using the [uv](https://docs.astral.sh/uv/) package manager, you might face +some difficulty when running `opentelemetry-bootstrap -a install`. + +Instead, you can generate the requirements dynamically and install them using +`uv`. + +First, install the appropriate packages (or add them to your project file and +run `uv sync`): + +```sh +uv pip install opentelemetry-distro opentelemetry-exporter-otlp +``` + +Now, you can install the auto instrumentation: + +```sh +uv run opentelemetry-bootstrap -a requirements | uv pip install --requirement - +``` + +Finally, use `uv run` to start your application (see +[Configuring the agent](#configuring-the-agent)): + +```sh +uv run opentelemetry-instrument python myapp.py +``` + +Please note that you have to reinstall the auto instrumentation every time you +run `uv sync` or update existing packages. It is therefore recommended to make +the installation part of your build pipeline. diff --git a/static/refcache.json b/static/refcache.json index 084a93c50e2e..8336adfe838d 100644 --- a/static/refcache.json +++ b/static/refcache.json @@ -2339,6 +2339,10 @@ "StatusCode": 200, "LastSeen": "2024-08-30T17:38:37.903633988Z" }, + "https://docs.astral.sh/uv/": { + "StatusCode": 200, + "LastSeen": "2024-11-21T10:24:48.633652602+01:00" + }, "https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-system-attributes": { "StatusCode": 206, "LastSeen": "2024-01-18T08:53:50.0122-05:00"