Skip to content

Commit

Permalink
Try to really clarify that you need flask and wekzeug < 3 (#4034)
Browse files Browse the repository at this point in the history
  • Loading branch information
cartermp authored Feb 21, 2024
1 parent 0b1a80f commit 6e8b143
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
6 changes: 5 additions & 1 deletion content/en/docs/kubernetes/operator/automatic.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ weight: 11
description:
An implementation of auto-instrumentation using the OpenTelemetry Operator.
# prettier-ignore
cSpell:ignore: autoinstrumentation GRPCNETCLIENT k8sattributesprocessor otelinst otlpreceiver PTRACE REDISCALA
cSpell:ignore: autoinstrumentation GRPCNETCLIENT k8sattributesprocessor otelinst otlpreceiver PTRACE REDISCALA Werkzeug
---

The OpenTelemetry Operator supports injecting and configuring
Expand Down Expand Up @@ -317,6 +317,10 @@ spec:
EOF
```

> **Note**: OpenTelemetry Python automatic instrumentation does not support
> Flask or Werkzeug 3.0+ at this time. See the troubleshooting section
> [No Data When Using Flask](/docs/languages/python/automatic#no-data-when-using-flask)
By default, the `Instrumentation` resource that auto-instruments Python services
uses `otlp` with the `http/protobuf` protocol (gRPC is not supported at this
time). This means that the configured endpoint must be able to receive OTLP over
Expand Down
16 changes: 15 additions & 1 deletion content/en/docs/languages/python/automatic/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
title: Automatic Instrumentation
linkTitle: Automatic
weight: 30
cSpell:ignore: devel distro mkdir myapp uninstrumented virtualenv
# prettier-ignore
cSpell:ignore: devel distro mkdir myapp pyproject uninstrumented virtualenv Werkzeug
---

Automatic instrumentation with Python uses a Python agent that can be attached
Expand Down Expand Up @@ -74,6 +75,19 @@ You can find the full list

## Troubleshooting

### No data when using Flask

Using OpenTelemetry with Flask requires both Flask and Werkzeug versions as <
3.0. Because Flask 2.x does not specify Werkzeug as < 3.0, conflicts can arise.

Ensure your Flask version is < 3.x, and specify the Werkzeug version explicitly
as < 3.0. For example, in a `pyproject.toml` file:

```console
flask = "2.2.2"
Werkzeug = "2.2.2"
```

### Python package installation failure

The Python package installs require `gcc` and `gcc-c++`, which you may need to
Expand Down
3 changes: 2 additions & 1 deletion content/en/docs/languages/python/automatic/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ pip install 'flask<3' 'werkzeug<3' requests
```

> **Note**: OpenTelemetry Python automatic instrumentation does not support
> Flask or Werkzeug 3.0+ at this time.
> Flask or Werkzeug 3.0+ at this time. See the troubleshooting section
> [No Data When Using Flask](/docs/languages/python/automatic#no-data-when-using-flask)
Run the `opentelemetry-bootstrap` command:

Expand Down
6 changes: 5 additions & 1 deletion content/en/docs/languages/python/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,16 @@ python3 -m venv venv
source ./venv/bin/activate
```

Now install Flask:
Now install Flask and Werkzeug:

```shell
pip install 'flask<3' 'werkzeug<3'
```

> **Note**: OpenTelemetry Python automatic instrumentation does not support
> Flask or Werkzeug 3.0+ at this time. See the troubleshooting section
> [No Data When Using Flask](/docs/languages/python/automatic#no-data-when-using-flask)
### Create and launch an HTTP Server

Create a file `app.py` and add the following code to it:
Expand Down

0 comments on commit 6e8b143

Please sign in to comment.