opentelemetry-instrumentation-openai 0.24.0__py3-none-any.whl → 0.25.0__py3-none-any.whl
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.
Potentially problematic release.
This version of opentelemetry-instrumentation-openai might be problematic. Click here for more details.
- opentelemetry/instrumentation/openai/shared/chat_wrappers.py +11 -3
- opentelemetry/instrumentation/openai/shared/completion_wrappers.py +11 -3
- opentelemetry/instrumentation/openai/shared/embeddings_wrappers.py +11 -3
- opentelemetry/instrumentation/openai/shared/image_gen_wrappers.py +4 -1
- opentelemetry/instrumentation/openai/version.py +1 -1
- {opentelemetry_instrumentation_openai-0.24.0.dist-info → opentelemetry_instrumentation_openai-0.25.0.dist-info}/METADATA +2 -2
- {opentelemetry_instrumentation_openai-0.24.0.dist-info → opentelemetry_instrumentation_openai-0.25.0.dist-info}/RECORD +9 -9
- {opentelemetry_instrumentation_openai-0.24.0.dist-info → opentelemetry_instrumentation_openai-0.25.0.dist-info}/WHEEL +0 -0
- {opentelemetry_instrumentation_openai-0.24.0.dist-info → opentelemetry_instrumentation_openai-0.25.0.dist-info}/entry_points.txt +0 -0
|
@@ -6,7 +6,11 @@ from wrapt import ObjectProxy
|
|
|
6
6
|
|
|
7
7
|
from opentelemetry import context as context_api
|
|
8
8
|
from opentelemetry.metrics import Counter, Histogram
|
|
9
|
-
from opentelemetry.semconv.ai import
|
|
9
|
+
from opentelemetry.semconv.ai import (
|
|
10
|
+
SUPPRESS_LANGUAGE_MODEL_INSTRUMENTATION_KEY,
|
|
11
|
+
SpanAttributes,
|
|
12
|
+
LLMRequestTypeValues,
|
|
13
|
+
)
|
|
10
14
|
|
|
11
15
|
from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY
|
|
12
16
|
from opentelemetry.instrumentation.openai.utils import (
|
|
@@ -56,7 +60,9 @@ def chat_wrapper(
|
|
|
56
60
|
args,
|
|
57
61
|
kwargs,
|
|
58
62
|
):
|
|
59
|
-
if context_api.get_value(_SUPPRESS_INSTRUMENTATION_KEY)
|
|
63
|
+
if context_api.get_value(_SUPPRESS_INSTRUMENTATION_KEY) or context_api.get_value(
|
|
64
|
+
SUPPRESS_LANGUAGE_MODEL_INSTRUMENTATION_KEY
|
|
65
|
+
):
|
|
60
66
|
return wrapped(*args, **kwargs)
|
|
61
67
|
|
|
62
68
|
# span needs to be opened and closed manually because the response is a generator
|
|
@@ -146,7 +152,9 @@ async def achat_wrapper(
|
|
|
146
152
|
args,
|
|
147
153
|
kwargs,
|
|
148
154
|
):
|
|
149
|
-
if context_api.get_value(_SUPPRESS_INSTRUMENTATION_KEY)
|
|
155
|
+
if context_api.get_value(_SUPPRESS_INSTRUMENTATION_KEY) or context_api.get_value(
|
|
156
|
+
SUPPRESS_LANGUAGE_MODEL_INSTRUMENTATION_KEY
|
|
157
|
+
):
|
|
150
158
|
return wrapped(*args, **kwargs)
|
|
151
159
|
|
|
152
160
|
span = tracer.start_span(
|
|
@@ -2,7 +2,11 @@ import logging
|
|
|
2
2
|
|
|
3
3
|
from opentelemetry import context as context_api
|
|
4
4
|
|
|
5
|
-
from opentelemetry.semconv.ai import
|
|
5
|
+
from opentelemetry.semconv.ai import (
|
|
6
|
+
SUPPRESS_LANGUAGE_MODEL_INSTRUMENTATION_KEY,
|
|
7
|
+
SpanAttributes,
|
|
8
|
+
LLMRequestTypeValues,
|
|
9
|
+
)
|
|
6
10
|
|
|
7
11
|
from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY
|
|
8
12
|
from opentelemetry.instrumentation.openai.utils import _with_tracer_wrapper, dont_throw
|
|
@@ -33,7 +37,9 @@ logger = logging.getLogger(__name__)
|
|
|
33
37
|
|
|
34
38
|
@_with_tracer_wrapper
|
|
35
39
|
def completion_wrapper(tracer, wrapped, instance, args, kwargs):
|
|
36
|
-
if context_api.get_value(_SUPPRESS_INSTRUMENTATION_KEY)
|
|
40
|
+
if context_api.get_value(_SUPPRESS_INSTRUMENTATION_KEY) or context_api.get_value(
|
|
41
|
+
SUPPRESS_LANGUAGE_MODEL_INSTRUMENTATION_KEY
|
|
42
|
+
):
|
|
37
43
|
return wrapped(*args, **kwargs)
|
|
38
44
|
|
|
39
45
|
# span needs to be opened and closed manually because the response is a generator
|
|
@@ -58,7 +64,9 @@ def completion_wrapper(tracer, wrapped, instance, args, kwargs):
|
|
|
58
64
|
|
|
59
65
|
@_with_tracer_wrapper
|
|
60
66
|
async def acompletion_wrapper(tracer, wrapped, instance, args, kwargs):
|
|
61
|
-
if context_api.get_value(_SUPPRESS_INSTRUMENTATION_KEY)
|
|
67
|
+
if context_api.get_value(_SUPPRESS_INSTRUMENTATION_KEY) or context_api.get_value(
|
|
68
|
+
SUPPRESS_LANGUAGE_MODEL_INSTRUMENTATION_KEY
|
|
69
|
+
):
|
|
62
70
|
return wrapped(*args, **kwargs)
|
|
63
71
|
|
|
64
72
|
span = tracer.start_span(
|
|
@@ -3,7 +3,11 @@ import time
|
|
|
3
3
|
|
|
4
4
|
from opentelemetry import context as context_api
|
|
5
5
|
from opentelemetry.metrics import Counter, Histogram
|
|
6
|
-
from opentelemetry.semconv.ai import
|
|
6
|
+
from opentelemetry.semconv.ai import (
|
|
7
|
+
SUPPRESS_LANGUAGE_MODEL_INSTRUMENTATION_KEY,
|
|
8
|
+
SpanAttributes,
|
|
9
|
+
LLMRequestTypeValues,
|
|
10
|
+
)
|
|
7
11
|
|
|
8
12
|
from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY
|
|
9
13
|
from opentelemetry.instrumentation.openai.utils import (
|
|
@@ -46,7 +50,9 @@ def embeddings_wrapper(
|
|
|
46
50
|
args,
|
|
47
51
|
kwargs,
|
|
48
52
|
):
|
|
49
|
-
if context_api.get_value(_SUPPRESS_INSTRUMENTATION_KEY)
|
|
53
|
+
if context_api.get_value(_SUPPRESS_INSTRUMENTATION_KEY) or context_api.get_value(
|
|
54
|
+
SUPPRESS_LANGUAGE_MODEL_INSTRUMENTATION_KEY
|
|
55
|
+
):
|
|
50
56
|
return wrapped(*args, **kwargs)
|
|
51
57
|
|
|
52
58
|
with tracer.start_as_current_span(
|
|
@@ -103,7 +109,9 @@ async def aembeddings_wrapper(
|
|
|
103
109
|
args,
|
|
104
110
|
kwargs,
|
|
105
111
|
):
|
|
106
|
-
if context_api.get_value(_SUPPRESS_INSTRUMENTATION_KEY)
|
|
112
|
+
if context_api.get_value(_SUPPRESS_INSTRUMENTATION_KEY) or context_api.get_value(
|
|
113
|
+
SUPPRESS_LANGUAGE_MODEL_INSTRUMENTATION_KEY
|
|
114
|
+
):
|
|
107
115
|
return wrapped(*args, **kwargs)
|
|
108
116
|
|
|
109
117
|
async with start_as_current_span_async(
|
|
@@ -12,6 +12,7 @@ from opentelemetry.instrumentation.openai.utils import (
|
|
|
12
12
|
)
|
|
13
13
|
from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY
|
|
14
14
|
from opentelemetry.metrics import Counter, Histogram
|
|
15
|
+
from opentelemetry.semconv.ai import SUPPRESS_LANGUAGE_MODEL_INSTRUMENTATION_KEY
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
@_with_image_gen_metric_wrapper
|
|
@@ -23,7 +24,9 @@ def image_gen_metrics_wrapper(
|
|
|
23
24
|
args,
|
|
24
25
|
kwargs,
|
|
25
26
|
):
|
|
26
|
-
if context_api.get_value(_SUPPRESS_INSTRUMENTATION_KEY)
|
|
27
|
+
if context_api.get_value(_SUPPRESS_INSTRUMENTATION_KEY) or context_api.get_value(
|
|
28
|
+
SUPPRESS_LANGUAGE_MODEL_INSTRUMENTATION_KEY
|
|
29
|
+
):
|
|
27
30
|
return wrapped(*args, **kwargs)
|
|
28
31
|
|
|
29
32
|
try:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.
|
|
1
|
+
__version__ = "0.25.0"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: opentelemetry-instrumentation-openai
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.25.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
|
|
@@ -17,7 +17,7 @@ Provides-Extra: instruments
|
|
|
17
17
|
Requires-Dist: opentelemetry-api (>=1.25.0,<2.0.0)
|
|
18
18
|
Requires-Dist: opentelemetry-instrumentation (>=0.46b0,<0.47)
|
|
19
19
|
Requires-Dist: opentelemetry-semantic-conventions (>=0.46b0,<0.47)
|
|
20
|
-
Requires-Dist: opentelemetry-semantic-conventions-ai (==0.3.
|
|
20
|
+
Requires-Dist: opentelemetry-semantic-conventions-ai (==0.3.4)
|
|
21
21
|
Requires-Dist: tiktoken (>=0.6.0,<1)
|
|
22
22
|
Project-URL: Repository, https://github.com/traceloop/openllmetry/tree/main/packages/opentelemetry-instrumentation-openai
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
opentelemetry/instrumentation/openai/__init__.py,sha256=xl3Kvqry9glVhu8VtdknfUE9FpXQ7KWAFqtVlpjE-40,1344
|
|
2
2
|
opentelemetry/instrumentation/openai/shared/__init__.py,sha256=vRPcdI_4Tseg7mBYRrDdWzRcnec3vZeC2tPYpLlT2Xc,8076
|
|
3
|
-
opentelemetry/instrumentation/openai/shared/chat_wrappers.py,sha256=
|
|
4
|
-
opentelemetry/instrumentation/openai/shared/completion_wrappers.py,sha256
|
|
3
|
+
opentelemetry/instrumentation/openai/shared/chat_wrappers.py,sha256=LiXWC-68HTq01lgCGytXf5j7oK7nsAwPuN48Sqb-FBU,25304
|
|
4
|
+
opentelemetry/instrumentation/openai/shared/completion_wrappers.py,sha256=UnygloMuP0udgMAE0ic6NJUVAqJ1CJKT-YjSe_9Ds0g,6834
|
|
5
5
|
opentelemetry/instrumentation/openai/shared/config.py,sha256=5uekQEnmYo1o6tsTD2IGc-cVmHUo5KmUC4pOVdrFFNk,102
|
|
6
|
-
opentelemetry/instrumentation/openai/shared/embeddings_wrappers.py,sha256=
|
|
7
|
-
opentelemetry/instrumentation/openai/shared/image_gen_wrappers.py,sha256=
|
|
6
|
+
opentelemetry/instrumentation/openai/shared/embeddings_wrappers.py,sha256=mHxMT6lkV92npXiYYm314bko3AaIkJ2s6MzrCL2CyXI,6926
|
|
7
|
+
opentelemetry/instrumentation/openai/shared/image_gen_wrappers.py,sha256=Gi9efZYsihVma-D-lo215KvRwTxiZdlzVG6COpSTA78,2124
|
|
8
8
|
opentelemetry/instrumentation/openai/utils.py,sha256=3ONjsia3xG4rRMOwjU91liOVpZxoRE39CxJ-C5HxIgQ,3464
|
|
9
9
|
opentelemetry/instrumentation/openai/v0/__init__.py,sha256=FYq3xhtaIdvy7mwCPzxaqNNGzfHEi0Q2JFQl51s6yNo,5475
|
|
10
10
|
opentelemetry/instrumentation/openai/v1/__init__.py,sha256=wDO1rjgeZRNVXXA3IJUdqYVXRsvst7_JTtAjBK-m1Gc,7693
|
|
11
11
|
opentelemetry/instrumentation/openai/v1/assistant_wrappers.py,sha256=4BDLcqOfwl0LFUdAjLE_PgRcWsQYKoCM_okWLCU8A9U,6277
|
|
12
12
|
opentelemetry/instrumentation/openai/v1/event_handler_wrapper.py,sha256=SAzYoun2yyOloofyOWtxpm8E2M9TL3Nm8TgKdNyXHuY,2779
|
|
13
|
-
opentelemetry/instrumentation/openai/version.py,sha256=
|
|
14
|
-
opentelemetry_instrumentation_openai-0.
|
|
15
|
-
opentelemetry_instrumentation_openai-0.
|
|
16
|
-
opentelemetry_instrumentation_openai-0.
|
|
17
|
-
opentelemetry_instrumentation_openai-0.
|
|
13
|
+
opentelemetry/instrumentation/openai/version.py,sha256=Mu4JbSLl5nr-J2figk5hmW2mrw4skf_oeIzxbnpcgwY,23
|
|
14
|
+
opentelemetry_instrumentation_openai-0.25.0.dist-info/METADATA,sha256=agtBc6DaeG6x7OGaa3Hr6kKu1mX-iSw4Pv00erqEWIw,2255
|
|
15
|
+
opentelemetry_instrumentation_openai-0.25.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
16
|
+
opentelemetry_instrumentation_openai-0.25.0.dist-info/entry_points.txt,sha256=vTBfiX5yXji5YHikuJHEOoBZ1TFdPQ1EI4ctd2pZSeE,93
|
|
17
|
+
opentelemetry_instrumentation_openai-0.25.0.dist-info/RECORD,,
|
|
File without changes
|