Skip to content

Commit

Permalink
Add uv package manager instructions to Python zero-code docs (#5635)
Browse files Browse the repository at this point in the history
  • Loading branch information
jord1e authored Nov 21, 2024
1 parent 1ce408a commit fec7c69
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
32 changes: 32 additions & 0 deletions content/en/docs/zero-code/python/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
4 changes: 4 additions & 0 deletions static/refcache.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit fec7c69

Please sign in to comment.