Skip to content

Commit fec7c69

Browse files
authored
Add uv package manager instructions to Python zero-code docs (#5635)
1 parent 1ce408a commit fec7c69

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

content/en/docs/zero-code/python/_index.md

+32
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,35 @@ export GRPC_VERBOSITY=debug
120120
export GRPC_TRACE=http,call_error,connectivity_state
121121
opentelemetry-instrument python YOUR_APP.py
122122
```
123+
124+
### Bootstrap using uv
125+
126+
When using the [uv](https://docs.astral.sh/uv/) package manager, you might face
127+
some difficulty when running `opentelemetry-bootstrap -a install`.
128+
129+
Instead, you can generate the requirements dynamically and install them using
130+
`uv`.
131+
132+
First, install the appropriate packages (or add them to your project file and
133+
run `uv sync`):
134+
135+
```sh
136+
uv pip install opentelemetry-distro opentelemetry-exporter-otlp
137+
```
138+
139+
Now, you can install the auto instrumentation:
140+
141+
```sh
142+
uv run opentelemetry-bootstrap -a requirements | uv pip install --requirement -
143+
```
144+
145+
Finally, use `uv run` to start your application (see
146+
[Configuring the agent](#configuring-the-agent)):
147+
148+
```sh
149+
uv run opentelemetry-instrument python myapp.py
150+
```
151+
152+
Please note that you have to reinstall the auto instrumentation every time you
153+
run `uv sync` or update existing packages. It is therefore recommended to make
154+
the installation part of your build pipeline.

static/refcache.json

+4
Original file line numberDiff line numberDiff line change
@@ -2339,6 +2339,10 @@
23392339
"StatusCode": 200,
23402340
"LastSeen": "2024-08-30T17:38:37.903633988Z"
23412341
},
2342+
"https://docs.astral.sh/uv/": {
2343+
"StatusCode": 200,
2344+
"LastSeen": "2024-11-21T10:24:48.633652602+01:00"
2345+
},
23422346
"https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-system-attributes": {
23432347
"StatusCode": 206,
23442348
"LastSeen": "2024-01-18T08:53:50.0122-05:00"

0 commit comments

Comments
 (0)