File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
instrumentation-genai/opentelemetry-instrumentation-openai-v2/example Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,10 @@ OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
77OTEL_EXPORTER_OTLP_PROTOCOL = grpc
88OTEL_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
1212OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED = true
13+ # Change to 'console' if your OTLP endpoint doesn't support logs
1314OTEL_LOGS_EXPORTER = otlp_proto_grpc
15+ # Set to false to hide prompt and completion content
16+ OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT = true
Original file line number Diff line number Diff line change @@ -2,8 +2,13 @@ OpenTelemetry OpenAI Instrumentation Example
22============================================
33
44This 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
813Installation
914------------
You can’t perform that action at this time.
0 commit comments