Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to really clarify that you need flask and wekzeug < 3 #4034

Merged
merged 4 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading