Skip to content

Commit be23e01

Browse files
polish
Signed-off-by: Adrian Cole <[email protected]>
1 parent 1c8c5e0 commit be23e01

File tree

2 files changed

+11
-3
lines changed
  • instrumentation-genai/opentelemetry-instrumentation-openai-v2/example

2 files changed

+11
-3
lines changed

instrumentation-genai/opentelemetry-instrumentation-openai-v2/example/.env

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
77
OTEL_EXPORTER_OTLP_PROTOCOL=grpc
88
OTEL_SERVICE_NAME=opentelemetry-instrumentation-openai-v2
99

10-
# Set to false or remove to disable log events
11-
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true
10+
11+
# This automatically configure logging
1212
OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true
13+
# Change to 'console' if your OTLP endpoint doesn't support logs
1314
OTEL_LOGS_EXPORTER=otlp_proto_grpc
15+
# Set to false to hide prompt and completion content
16+
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true

instrumentation-genai/opentelemetry-instrumentation-openai-v2/example/README.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@ OpenTelemetry OpenAI Instrumentation Example
22
============================================
33

44
This is an example of how to instrument OpenAI calls with zero code changes,
5-
using `opentelemetry-instrument`
5+
using `opentelemetry-instrument`.
66

7+
When [main.py](main.py) is run, it exports traces and logs to an
8+
OTLP-compatible endpoint. Traces include details such as the model used and the
9+
duration of the chat request. Logs capture the chat request and the generated
10+
response, providing a comprehensive view of the performance and behavior of
11+
your OpenAI requests.
712

813
Installation
914
------------

0 commit comments

Comments
 (0)