Skip to content

Commit a360307

Browse files
committed
Update documentation
1 parent df2dd1f commit a360307

File tree

1 file changed

+8
-1
lines changed
  • instrumentation-genai/opentelemetry-instrumentation-openai-v2

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Check out the `manual example <examples/manual>`_ for more details.
5656
Instrumenting all clients
5757
*************************
5858

59-
When using the instrumentor, all clients will automatically trace OpenAI chat completion operations.
59+
When using the instrumentor, all clients will automatically trace OpenAI operations including chat completions and embeddings.
6060
You can also optionally capture prompts and completions as log events.
6161

6262
Make sure to configure OpenTelemetry tracing, logging, and events to capture all telemetry emitted by the instrumentation.
@@ -68,12 +68,19 @@ Make sure to configure OpenTelemetry tracing, logging, and events to capture all
6868
OpenAIInstrumentor().instrument()
6969
7070
client = OpenAI()
71+
# Chat completion example
7172
response = client.chat.completions.create(
7273
model="gpt-4o-mini",
7374
messages=[
7475
{"role": "user", "content": "Write a short poem on open telemetry."},
7576
],
7677
)
78+
79+
# Embeddings example
80+
embedding_response = client.embeddings.create(
81+
model="text-embedding-3-small",
82+
input="Generate vector embeddings for this text"
83+
)
7784
7885
Enabling message content
7986
*************************

0 commit comments

Comments
 (0)