opentelemetry-instrumentation-openai 0.26.5__tar.gz → 0.28.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {opentelemetry_instrumentation_openai-0.26.5 → opentelemetry_instrumentation_openai-0.28.0}/PKG-INFO +1 -1
- {opentelemetry_instrumentation_openai-0.26.5 → opentelemetry_instrumentation_openai-0.28.0}/opentelemetry/instrumentation/openai/shared/__init__.py +2 -4
- {opentelemetry_instrumentation_openai-0.26.5 → opentelemetry_instrumentation_openai-0.28.0}/opentelemetry/instrumentation/openai/shared/chat_wrappers.py +5 -5
- {opentelemetry_instrumentation_openai-0.26.5 → opentelemetry_instrumentation_openai-0.28.0}/opentelemetry/instrumentation/openai/shared/embeddings_wrappers.py +3 -0
- opentelemetry_instrumentation_openai-0.28.0/opentelemetry/instrumentation/openai/version.py +1 -0
- {opentelemetry_instrumentation_openai-0.26.5 → opentelemetry_instrumentation_openai-0.28.0}/pyproject.toml +1 -1
- opentelemetry_instrumentation_openai-0.26.5/opentelemetry/instrumentation/openai/version.py +0 -1
- {opentelemetry_instrumentation_openai-0.26.5 → opentelemetry_instrumentation_openai-0.28.0}/README.md +0 -0
- {opentelemetry_instrumentation_openai-0.26.5 → opentelemetry_instrumentation_openai-0.28.0}/opentelemetry/instrumentation/openai/__init__.py +0 -0
- {opentelemetry_instrumentation_openai-0.26.5 → opentelemetry_instrumentation_openai-0.28.0}/opentelemetry/instrumentation/openai/shared/completion_wrappers.py +0 -0
- {opentelemetry_instrumentation_openai-0.26.5 → opentelemetry_instrumentation_openai-0.28.0}/opentelemetry/instrumentation/openai/shared/config.py +0 -0
- {opentelemetry_instrumentation_openai-0.26.5 → opentelemetry_instrumentation_openai-0.28.0}/opentelemetry/instrumentation/openai/shared/image_gen_wrappers.py +0 -0
- {opentelemetry_instrumentation_openai-0.26.5 → opentelemetry_instrumentation_openai-0.28.0}/opentelemetry/instrumentation/openai/utils.py +0 -0
- {opentelemetry_instrumentation_openai-0.26.5 → opentelemetry_instrumentation_openai-0.28.0}/opentelemetry/instrumentation/openai/v0/__init__.py +0 -0
- {opentelemetry_instrumentation_openai-0.26.5 → opentelemetry_instrumentation_openai-0.28.0}/opentelemetry/instrumentation/openai/v1/__init__.py +0 -0
- {opentelemetry_instrumentation_openai-0.26.5 → opentelemetry_instrumentation_openai-0.28.0}/opentelemetry/instrumentation/openai/v1/assistant_wrappers.py +0 -0
- {opentelemetry_instrumentation_openai-0.26.5 → opentelemetry_instrumentation_openai-0.28.0}/opentelemetry/instrumentation/openai/v1/event_handler_wrapper.py +0 -0
{opentelemetry_instrumentation_openai-0.26.5 → opentelemetry_instrumentation_openai-0.28.0}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: opentelemetry-instrumentation-openai
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.28.0
|
|
4
4
|
Summary: OpenTelemetry OpenAI instrumentation
|
|
5
5
|
Home-page: https://github.com/traceloop/openllmetry/tree/main/packages/opentelemetry-instrumentation-openai
|
|
6
6
|
License: Apache-2.0
|
|
@@ -33,10 +33,8 @@ def should_send_prompts():
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
def _set_span_attribute(span, name, value):
|
|
36
|
-
if value is not None:
|
|
37
|
-
|
|
38
|
-
span.set_attribute(name, value)
|
|
39
|
-
return
|
|
36
|
+
if value is not None and value != "" and value != openai.NOT_GIVEN:
|
|
37
|
+
span.set_attribute(name, value)
|
|
40
38
|
|
|
41
39
|
|
|
42
40
|
def _set_client_attributes(span, instance):
|
|
@@ -39,7 +39,7 @@ from opentelemetry.instrumentation.openai.shared import (
|
|
|
39
39
|
from opentelemetry.trace import SpanKind, Tracer
|
|
40
40
|
from opentelemetry.trace.status import Status, StatusCode
|
|
41
41
|
|
|
42
|
-
from opentelemetry.instrumentation.openai.utils import is_openai_v1
|
|
42
|
+
from opentelemetry.instrumentation.openai.utils import is_openai_v1
|
|
43
43
|
|
|
44
44
|
SPAN_NAME = "openai.chat"
|
|
45
45
|
PROMPT_FILTER_KEY = "prompt_filter_results"
|
|
@@ -428,6 +428,7 @@ def _set_completions(span, choices):
|
|
|
428
428
|
)
|
|
429
429
|
|
|
430
430
|
|
|
431
|
+
@dont_throw
|
|
431
432
|
def _set_streaming_token_metrics(
|
|
432
433
|
request_kwargs, complete_response, span, token_counter, shared_attributes
|
|
433
434
|
):
|
|
@@ -745,10 +746,9 @@ async def _abuild_from_streaming_response(
|
|
|
745
746
|
"stream": True,
|
|
746
747
|
}
|
|
747
748
|
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
)
|
|
749
|
+
_set_streaming_token_metrics(
|
|
750
|
+
request_kwargs, complete_response, span, token_counter, shared_attributes
|
|
751
|
+
)
|
|
752
752
|
|
|
753
753
|
# choice metrics
|
|
754
754
|
if choice_counter and complete_response.get("choices"):
|
|
@@ -209,6 +209,9 @@ def _set_embeddings_metrics(
|
|
|
209
209
|
if usage and token_counter:
|
|
210
210
|
for name, val in usage.items():
|
|
211
211
|
if name in OPENAI_LLM_USAGE_TOKEN_TYPES:
|
|
212
|
+
if val is None:
|
|
213
|
+
logging.error(f"Received None value for {name} in usage")
|
|
214
|
+
continue
|
|
212
215
|
attributes_with_token_type = {
|
|
213
216
|
**shared_attributes,
|
|
214
217
|
SpanAttributes.LLM_TOKEN_TYPE: _token_type(name),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.28.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.26.5"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|