|
1 | 1 | OpenTelemetry Util for GenAI |
2 | | -======================= |
| 2 | +============================ |
3 | 3 |
|
4 | 4 |
|
5 | 5 | The GenAI Utils package will include boilerplate and helpers to standardize instrumentation for Generative AI. |
6 | 6 | This package will provide APIs and decorators to minimize the work needed to instrument genai libraries, |
7 | 7 | while providing standardization for generating both types of otel, "spans and metrics" and "spans, metrics and events" |
8 | 8 |
|
9 | 9 | This package provides these span attributes. |
10 | | --> gen_ai.operation.name: Str(chat) |
11 | 10 | -> 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 |
13 | 14 | -> gen_ai.request.model: Str(gpt-3.5-turbo) |
14 | 15 | -> gen_ai.response.finish_reasons: Slice(["stop"]) |
15 | 16 | -> gen_ai.response.model: Str(gpt-3.5-turbo-0125) |
16 | 17 | -> gen_ai.response.id: Str(chatcmpl-Bz8yrvPnydD9pObv625n2CGBPHS13) |
17 | 18 | -> gen_ai.usage.input_tokens: Int(24) |
18 | 19 | -> 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) |
19 | 40 |
|
20 | 41 | Installation |
21 | 42 | ------------ |
|
0 commit comments