Skip to content

Commit 156ddab

Browse files
committed
elastic-opentelemetry-instrumentation-openai: Update README after semconv 1.29.0
1 parent 1720368 commit 156ddab

File tree

2 files changed

+8
-6
lines changed
  • instrumentation/elastic-opentelemetry-instrumentation-openai

2 files changed

+8
-6
lines changed

instrumentation/elastic-opentelemetry-instrumentation-openai/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ We currently support the following features:
1010
- Functions calling with tools for chat completions
1111
- Client side metrics
1212
- Embeddings API calls
13-
- Following 1.28.0 Gen AI Semantic Conventions
13+
- Following 1.29.0 Gen AI Semantic Conventions
1414

1515
## Installation
1616

@@ -60,8 +60,7 @@ log events instead of span events.
6060

6161
### Elastic specific semantic conventions
6262

63-
- New `embeddings` value for `gen_ai.operation.name`
64-
- New `gen_ai.request.encoding_formats` attribute with openai specific values `[[float], [base64]]`
63+
None at the moment
6564

6665
## Development
6766

instrumentation/elastic-opentelemetry-instrumentation-openai/src/opentelemetry/instrumentation/openai/helpers.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@
3838
GEN_AI_USAGE_INPUT_TOKENS,
3939
GEN_AI_USAGE_OUTPUT_TOKENS,
4040
)
41+
try:
42+
from opentelemetry.semconv._incubating.attributes.gen_ai_attributes import GEN_AI_REQUEST_ENCODING_FORMATS
43+
except ImportError:
44+
# available since 1.29.0
45+
GEN_AI_REQUEST_ENCODING_FORMATS = "gen_ai.request.encoding_formats"
46+
4147
from opentelemetry.metrics import Histogram
4248
from opentelemetry.trace import Span
4349
from opentelemetry.util.types import Attributes
@@ -48,9 +54,6 @@
4854
EVENT_GEN_AI_SYSTEM_MESSAGE = "gen_ai.system.message"
4955
EVENT_GEN_AI_TOOL_MESSAGE = "gen_ai.tool.message"
5056

51-
# not yet released attributes
52-
GEN_AI_REQUEST_ENCODING_FORMATS = "gen_ai.request.encoding_formats"
53-
5457
# As this is only used for a type annotation, only import from openai module
5558
# when running type checker like pyright since we otherwise don't want to import
5659
# it before the app.

0 commit comments

Comments
 (0)