Skip to content

Commit 8342185

Browse files
committed
Fix fprocess in python OTEL instrumentation
Signed-off-by: Han Verstraete (OpenFaaS Ltd) <[email protected]>
1 parent 0a2aad8 commit 8342185

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

docs/languages/python.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -421,17 +421,13 @@ RUN pip install --no-cache-dir --user -r requirements.txt
421421

422422
The `opentelemetry-bootstrap -a install` command reads through the list of packages installed in your active site-packages folder, and installs the corresponding instrumentation libraries for these packages, if applicable. The OpenTelemetry Python agent uses [monkey patching](https://stackoverflow.com/questions/5626193/what-is-monkey-patching) to modify functions in these libraries at runtime.
423423

424-
425-
Update the fprocess ENV in the Dockerfile to start the OpenTelemetry agent:
424+
Update the function process in `template.yaml`to start the OpenTelemetry agent:
426425

427426
```diff
428-
# configure WSGI server and healthcheck
429-
USER app
430-
431-
- ENV fprocess="python index.py"
432-
+ ENV fprocess="opentelemetry-instrument python index.py"
427+
language: python3-http
428+
- fprocess: python index.py
429+
+ fprocess: opentelemetry-instrument python index.py
433430
```
434-
435431
Use your modified template to create a new function.
436432

437433
The OpenTelemetry agent can be configured using environment variables on the function:

0 commit comments

Comments
 (0)