Skip to content

Commit a1485d2

Browse files
keith-deckerzhirafovod
authored andcommitted
update documentation
1 parent 70e8d1d commit a1485d2

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

util/opentelemetry-util-genai/README.rst

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,36 @@ This package will provide APIs and decorators to minimize the work needed to ins
77
while providing standardization for generating both types of otel, "spans and metrics" and "spans, metrics and events"
88

99
This package provides these span attributes.
10-
-> gen_ai.operation.name: Str(chat)
1110
-> gen_ai.provider.name: Str(openai)
12-
-> gen_ai.system: Str(ChatOpenAI)
11+
-> gen_ai.operation.name: Str(chat)
12+
-> gen_ai.framework: Str(langchain)
13+
-> gen_ai.system: Str(openai) # deprecated
1314
-> gen_ai.request.model: Str(gpt-3.5-turbo)
1415
-> gen_ai.response.finish_reasons: Slice(["stop"])
1516
-> gen_ai.response.model: Str(gpt-3.5-turbo-0125)
1617
-> gen_ai.response.id: Str(chatcmpl-Bz8yrvPnydD9pObv625n2CGBPHS13)
1718
-> gen_ai.usage.input_tokens: Int(24)
1819
-> gen_ai.usage.output_tokens: Int(7)
20+
-> gen_ai.input.messages: Str("[{\"role\": \"user\", \"content\": \"hello world\"}]")
21+
22+
23+
This package also provides these metric attributes.
24+
Token Usage Metrics:
25+
-> gen_ai.provider.name: Str(openai)
26+
-> gen_ai.operation.name: Str(chat)
27+
-> gen_ai.framework: Str(langchain)
28+
-> gen_ai.request.model: Str(gpt-3.5-turbo)
29+
-> gen_ai.response.model: Str(gpt-3.5-turbo-0125)
30+
-> gen_ai.usage.input_tokens: Int(24)
31+
-> gen_ai.usage.output_tokens: Int(7)
32+
-> gen_ai.token.type: Str(input|output)
33+
34+
Duration Metrics:
35+
-> gen_ai.provider.name: Str(openai)
36+
-> gen_ai.operation.name: Str(chat)
37+
-> gen_ai.framework: Str(langchain)
38+
-> gen_ai.request.model: Str(gpt-3.5-turbo)
39+
-> gen_ai.response.model: Str(gpt-3.5-turbo-0125)
1940

2041
Installation
2142
------------

util/opentelemetry-util-genai/tests/test_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ def test_llm_start_and_stop_creates_span(
156156
# Add more attribute checks as needed
157157

158158
# Verify span timing
159-
assert span.start_time > 0
159+
assert span.start_time is not None
160+
assert span.end_time is not None
160161
assert span.end_time > span.start_time
161162

162163
# Verify invocation data

0 commit comments

Comments
 (0)