Skip to content

Commit 92cd5c8

Browse files
committed
update documentation
1 parent a2e017a commit 92cd5c8

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

util/opentelemetry-util-genai/README.rst

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,42 @@
11
OpenTelemetry Util for GenAI
2-
=======================
2+
============================
33

44

55
The GenAI Utils package will include boilerplate and helpers to standardize instrumentation for Generative AI.
66
This package will provide APIs and decorators to minimize the work needed to instrument genai libraries,
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
@@ -71,7 +71,8 @@ def test_llm_start_and_stop_creates_span(
7171
# Add more attribute checks as needed
7272

7373
# Verify span timing
74-
assert span.start_time > 0
74+
assert span.start_time is not None
75+
assert span.end_time is not None
7576
assert span.end_time > span.start_time
7677

7778
# Verify invocation data

0 commit comments

Comments
 (0)