Fix openaiv2 example readme (#3276)

* Fix openaiv2 example readme

* update manual as well

---------

Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
This commit is contained in:
Emídio Neto
2025-02-21 05:46:28 -03:00
committed by GitHub
parent 2f5b0bf1fc
commit 17a57bf6d3
2 changed files with 8 additions and 13 deletions

View File

@ -11,16 +11,14 @@ your OpenAI requests.
Note: `.env <.env>`_ file configures additional environment variables:
- `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true` configures
OpenAI instrumentation to capture prompt and completion contents on
events.
- ``OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true`` configures OpenAI instrumentation to capture prompt and completion contents on events.
Setup
-----
Minimally, update the `.env <.env>`_ file with your "OPENAI_API_KEY". An
Minimally, update the `.env <.env>`_ file with your ``OPENAI_API_KEY``. An
OTLP compatible endpoint should be listening for traces and logs on
http://localhost:4317. If not, update "OTEL_EXPORTER_OTLP_ENDPOINT" as well.
http://localhost:4317. If not, update ``OTEL_EXPORTER_OTLP_ENDPOINT`` as well.
Next, set up a virtual environment like this:

View File

@ -12,19 +12,16 @@ your OpenAI requests.
Note: `.env <.env>`_ file configures additional environment variables:
- `OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true` configures
OpenTelemetry SDK to export logs and events.
- `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true` configures
OpenAI instrumentation to capture prompt and completion contents on
events.
- `OTEL_LOGS_EXPORTER=otlp` to specify exporter type.
- ``OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true`` configures OpenTelemetry SDK to export logs and events.
- ``OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true`` configures OpenAI instrumentation to capture prompt and completion contents on events.
- ``OTEL_LOGS_EXPORTER=otlp`` to specify exporter type.
Setup
-----
Minimally, update the `.env <.env>`_ file with your "OPENAI_API_KEY". An
Minimally, update the `.env <.env>`_ file with your ``OPENAI_API_KEY``. An
OTLP compatible endpoint should be listening for traces and logs on
http://localhost:4317. If not, update "OTEL_EXPORTER_OTLP_ENDPOINT" as well.
http://localhost:4317. If not, update ``OTEL_EXPORTER_OTLP_ENDPOINT`` as well.
Next, set up a virtual environment like this: