opentelemetry-instrumentation-llamaindex 0.25.0__tar.gz → 0.25.1__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.
Potentially problematic release.
This version of opentelemetry-instrumentation-llamaindex might be problematic. Click here for more details.
- {opentelemetry_instrumentation_llamaindex-0.25.0 → opentelemetry_instrumentation_llamaindex-0.25.1}/PKG-INFO +1 -1
- {opentelemetry_instrumentation_llamaindex-0.25.0 → opentelemetry_instrumentation_llamaindex-0.25.1}/opentelemetry/instrumentation/llamaindex/base_agent_instrumentor.py +10 -2
- {opentelemetry_instrumentation_llamaindex-0.25.0 → opentelemetry_instrumentation_llamaindex-0.25.1}/opentelemetry/instrumentation/llamaindex/base_retriever_instrumentor.py +10 -2
- {opentelemetry_instrumentation_llamaindex-0.25.0 → opentelemetry_instrumentation_llamaindex-0.25.1}/opentelemetry/instrumentation/llamaindex/base_synthesizer_instrumentor.py +10 -2
- {opentelemetry_instrumentation_llamaindex-0.25.0 → opentelemetry_instrumentation_llamaindex-0.25.1}/opentelemetry/instrumentation/llamaindex/base_tool_instrumentor.py +10 -2
- {opentelemetry_instrumentation_llamaindex-0.25.0 → opentelemetry_instrumentation_llamaindex-0.25.1}/opentelemetry/instrumentation/llamaindex/query_pipeline_instrumentor.py +10 -2
- {opentelemetry_instrumentation_llamaindex-0.25.0 → opentelemetry_instrumentation_llamaindex-0.25.1}/opentelemetry/instrumentation/llamaindex/retriever_query_engine_instrumentor.py +10 -2
- {opentelemetry_instrumentation_llamaindex-0.25.0 → opentelemetry_instrumentation_llamaindex-0.25.1}/opentelemetry/instrumentation/llamaindex/utils.py +32 -0
- opentelemetry_instrumentation_llamaindex-0.25.1/opentelemetry/instrumentation/llamaindex/version.py +1 -0
- {opentelemetry_instrumentation_llamaindex-0.25.0 → opentelemetry_instrumentation_llamaindex-0.25.1}/pyproject.toml +4 -4
- opentelemetry_instrumentation_llamaindex-0.25.0/opentelemetry/instrumentation/llamaindex/version.py +0 -1
- {opentelemetry_instrumentation_llamaindex-0.25.0 → opentelemetry_instrumentation_llamaindex-0.25.1}/README.md +0 -0
- {opentelemetry_instrumentation_llamaindex-0.25.0 → opentelemetry_instrumentation_llamaindex-0.25.1}/opentelemetry/instrumentation/llamaindex/__init__.py +0 -0
- {opentelemetry_instrumentation_llamaindex-0.25.0 → opentelemetry_instrumentation_llamaindex-0.25.1}/opentelemetry/instrumentation/llamaindex/base_embedding_instrumentor.py +0 -0
- {opentelemetry_instrumentation_llamaindex-0.25.0 → opentelemetry_instrumentation_llamaindex-0.25.1}/opentelemetry/instrumentation/llamaindex/config.py +0 -0
- {opentelemetry_instrumentation_llamaindex-0.25.0 → opentelemetry_instrumentation_llamaindex-0.25.1}/opentelemetry/instrumentation/llamaindex/custom_llm_instrumentor.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: opentelemetry-instrumentation-llamaindex
|
|
3
|
-
Version: 0.25.
|
|
3
|
+
Version: 0.25.1
|
|
4
4
|
Summary: OpenTelemetry LlamaIndex instrumentation
|
|
5
5
|
Home-page: https://github.com/traceloop/openllmetry/tree/main/packages/opentelemetry-instrumentation-llamaindex
|
|
6
6
|
License: Apache-2.0
|
|
@@ -4,6 +4,8 @@ from wrapt import wrap_function_wrapper
|
|
|
4
4
|
|
|
5
5
|
from opentelemetry.instrumentation.llamaindex.utils import (
|
|
6
6
|
_with_tracer_wrapper,
|
|
7
|
+
process_request,
|
|
8
|
+
process_response,
|
|
7
9
|
start_as_current_span_async,
|
|
8
10
|
)
|
|
9
11
|
from opentelemetry.semconv.ai import SpanAttributes, TraceloopSpanKindValues
|
|
@@ -54,7 +56,10 @@ def query_wrapper(tracer, wrapped, instance, args, kwargs):
|
|
|
54
56
|
TraceloopSpanKindValues.AGENT.value,
|
|
55
57
|
)
|
|
56
58
|
|
|
57
|
-
|
|
59
|
+
process_request(span, args, kwargs)
|
|
60
|
+
res = wrapped(*args, **kwargs)
|
|
61
|
+
process_response(span, res)
|
|
62
|
+
return res
|
|
58
63
|
|
|
59
64
|
|
|
60
65
|
@_with_tracer_wrapper
|
|
@@ -67,4 +72,7 @@ async def aquery_wrapper(tracer, wrapped, instance, args, kwargs):
|
|
|
67
72
|
TraceloopSpanKindValues.AGENT.value,
|
|
68
73
|
)
|
|
69
74
|
|
|
70
|
-
|
|
75
|
+
process_request(span, args, kwargs)
|
|
76
|
+
res = await wrapped(*args, **kwargs)
|
|
77
|
+
process_response(span, res)
|
|
78
|
+
return res
|
|
@@ -4,6 +4,8 @@ from wrapt import wrap_function_wrapper
|
|
|
4
4
|
|
|
5
5
|
from opentelemetry.instrumentation.llamaindex.utils import (
|
|
6
6
|
_with_tracer_wrapper,
|
|
7
|
+
process_request,
|
|
8
|
+
process_response,
|
|
7
9
|
start_as_current_span_async,
|
|
8
10
|
)
|
|
9
11
|
from opentelemetry.semconv.ai import SpanAttributes, TraceloopSpanKindValues
|
|
@@ -47,7 +49,10 @@ def retrieve_wrapper(tracer, wrapped, instance, args, kwargs):
|
|
|
47
49
|
TraceloopSpanKindValues.TASK.value,
|
|
48
50
|
)
|
|
49
51
|
|
|
50
|
-
|
|
52
|
+
process_request(span, args, kwargs)
|
|
53
|
+
res = wrapped(*args, **kwargs)
|
|
54
|
+
process_response(span, res)
|
|
55
|
+
return res
|
|
51
56
|
|
|
52
57
|
|
|
53
58
|
@_with_tracer_wrapper
|
|
@@ -60,4 +65,7 @@ async def aretrieve_wrapper(tracer, wrapped, instance, args, kwargs):
|
|
|
60
65
|
TraceloopSpanKindValues.TASK.value,
|
|
61
66
|
)
|
|
62
67
|
|
|
63
|
-
|
|
68
|
+
process_request(span, args, kwargs)
|
|
69
|
+
res = await wrapped(*args, **kwargs)
|
|
70
|
+
process_response(span, res)
|
|
71
|
+
return res
|
|
@@ -4,6 +4,8 @@ from wrapt import wrap_function_wrapper
|
|
|
4
4
|
|
|
5
5
|
from opentelemetry.instrumentation.llamaindex.utils import (
|
|
6
6
|
_with_tracer_wrapper,
|
|
7
|
+
process_request,
|
|
8
|
+
process_response,
|
|
7
9
|
start_as_current_span_async,
|
|
8
10
|
)
|
|
9
11
|
from opentelemetry.semconv.ai import SpanAttributes, TraceloopSpanKindValues
|
|
@@ -46,7 +48,10 @@ def synthesize_wrapper(tracer, wrapped, instance, args, kwargs):
|
|
|
46
48
|
TraceloopSpanKindValues.TASK.value,
|
|
47
49
|
)
|
|
48
50
|
|
|
49
|
-
|
|
51
|
+
process_request(span, args, kwargs)
|
|
52
|
+
res = wrapped(*args, **kwargs)
|
|
53
|
+
process_response(span, res)
|
|
54
|
+
return res
|
|
50
55
|
|
|
51
56
|
|
|
52
57
|
@_with_tracer_wrapper
|
|
@@ -59,4 +64,7 @@ async def asynthesize_wrapper(tracer, wrapped, instance, args, kwargs):
|
|
|
59
64
|
TraceloopSpanKindValues.TASK.value,
|
|
60
65
|
)
|
|
61
66
|
|
|
62
|
-
|
|
67
|
+
process_request(span, args, kwargs)
|
|
68
|
+
res = await wrapped(*args, **kwargs)
|
|
69
|
+
process_response(span, res)
|
|
70
|
+
return res
|
|
@@ -4,6 +4,8 @@ from wrapt import wrap_function_wrapper
|
|
|
4
4
|
|
|
5
5
|
from opentelemetry.instrumentation.llamaindex.utils import (
|
|
6
6
|
_with_tracer_wrapper,
|
|
7
|
+
process_request,
|
|
8
|
+
process_response,
|
|
7
9
|
start_as_current_span_async,
|
|
8
10
|
)
|
|
9
11
|
from opentelemetry.semconv.ai import SpanAttributes, TraceloopSpanKindValues
|
|
@@ -56,7 +58,10 @@ def query_wrapper(tracer, wrapped, instance, args, kwargs):
|
|
|
56
58
|
TraceloopSpanKindValues.TOOL.value,
|
|
57
59
|
)
|
|
58
60
|
|
|
59
|
-
|
|
61
|
+
process_request(span, args, kwargs)
|
|
62
|
+
res = wrapped(*args, **kwargs)
|
|
63
|
+
process_response(span, res)
|
|
64
|
+
return res
|
|
60
65
|
|
|
61
66
|
|
|
62
67
|
@_with_tracer_wrapper
|
|
@@ -69,4 +74,7 @@ async def aquery_wrapper(tracer, wrapped, instance, args, kwargs):
|
|
|
69
74
|
TraceloopSpanKindValues.TOOL.value,
|
|
70
75
|
)
|
|
71
76
|
|
|
72
|
-
|
|
77
|
+
process_request(span, args, kwargs)
|
|
78
|
+
res = await wrapped(*args, **kwargs)
|
|
79
|
+
process_response(span, res)
|
|
80
|
+
return res
|
|
@@ -5,6 +5,8 @@ from opentelemetry.context import attach, set_value
|
|
|
5
5
|
|
|
6
6
|
from opentelemetry.instrumentation.llamaindex.utils import (
|
|
7
7
|
_with_tracer_wrapper,
|
|
8
|
+
process_request,
|
|
9
|
+
process_response,
|
|
8
10
|
start_as_current_span_async,
|
|
9
11
|
)
|
|
10
12
|
from opentelemetry.semconv.ai import SpanAttributes, TraceloopSpanKindValues
|
|
@@ -52,7 +54,10 @@ def run_wrapper(tracer, wrapped, instance, args, kwargs):
|
|
|
52
54
|
TraceloopSpanKindValues.WORKFLOW.value,
|
|
53
55
|
)
|
|
54
56
|
|
|
55
|
-
|
|
57
|
+
process_request(span, args, kwargs)
|
|
58
|
+
res = wrapped(*args, **kwargs)
|
|
59
|
+
process_response(span, res)
|
|
60
|
+
return res
|
|
56
61
|
|
|
57
62
|
|
|
58
63
|
@_with_tracer_wrapper
|
|
@@ -67,4 +72,7 @@ async def arun_wrapper(tracer, wrapped, instance, args, kwargs):
|
|
|
67
72
|
TraceloopSpanKindValues.WORKFLOW.value,
|
|
68
73
|
)
|
|
69
74
|
|
|
70
|
-
|
|
75
|
+
process_request(span, args, kwargs)
|
|
76
|
+
res = await wrapped(*args, **kwargs)
|
|
77
|
+
process_response(span, res)
|
|
78
|
+
return res
|
|
@@ -5,6 +5,8 @@ from opentelemetry.context import attach, set_value
|
|
|
5
5
|
|
|
6
6
|
from opentelemetry.instrumentation.llamaindex.utils import (
|
|
7
7
|
_with_tracer_wrapper,
|
|
8
|
+
process_request,
|
|
9
|
+
process_response,
|
|
8
10
|
start_as_current_span_async,
|
|
9
11
|
)
|
|
10
12
|
from opentelemetry.semconv.ai import SpanAttributes, TraceloopSpanKindValues
|
|
@@ -53,7 +55,10 @@ def query_wrapper(tracer, wrapped, instance, args, kwargs):
|
|
|
53
55
|
TraceloopSpanKindValues.WORKFLOW.value,
|
|
54
56
|
)
|
|
55
57
|
|
|
56
|
-
|
|
58
|
+
process_request(span, args, kwargs)
|
|
59
|
+
res = wrapped(*args, **kwargs)
|
|
60
|
+
process_response(span, res)
|
|
61
|
+
return res
|
|
57
62
|
|
|
58
63
|
|
|
59
64
|
@_with_tracer_wrapper
|
|
@@ -68,4 +73,7 @@ async def aquery_wrapper(tracer, wrapped, instance, args, kwargs):
|
|
|
68
73
|
TraceloopSpanKindValues.WORKFLOW.value,
|
|
69
74
|
)
|
|
70
75
|
|
|
71
|
-
|
|
76
|
+
process_request(span, args, kwargs)
|
|
77
|
+
res = await wrapped(*args, **kwargs)
|
|
78
|
+
process_response(span, res)
|
|
79
|
+
return res
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import dataclasses
|
|
2
|
+
import json
|
|
1
3
|
import os
|
|
2
4
|
import logging
|
|
3
5
|
import traceback
|
|
@@ -5,6 +7,7 @@ from contextlib import asynccontextmanager
|
|
|
5
7
|
|
|
6
8
|
from opentelemetry import context as context_api
|
|
7
9
|
from opentelemetry.instrumentation.llamaindex.config import Config
|
|
10
|
+
from opentelemetry.semconv.ai import SpanAttributes
|
|
8
11
|
|
|
9
12
|
|
|
10
13
|
def _with_tracer_wrapper(func):
|
|
@@ -52,3 +55,32 @@ def dont_throw(func):
|
|
|
52
55
|
Config.exception_logger(e)
|
|
53
56
|
|
|
54
57
|
return wrapper
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class JSONEncoder(json.JSONEncoder):
|
|
61
|
+
def default(self, o):
|
|
62
|
+
if dataclasses.is_dataclass(o):
|
|
63
|
+
return dataclasses.asdict(o)
|
|
64
|
+
elif hasattr(o, "json"):
|
|
65
|
+
return o.json()
|
|
66
|
+
elif hasattr(o, "to_json"):
|
|
67
|
+
return o.to_json()
|
|
68
|
+
return super().default(o)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
@dont_throw
|
|
72
|
+
def process_request(span, args, kwargs):
|
|
73
|
+
if should_send_prompts():
|
|
74
|
+
span.set_attribute(
|
|
75
|
+
SpanAttributes.TRACELOOP_ENTITY_INPUT,
|
|
76
|
+
json.dumps({"args": args, "kwargs": kwargs}, cls=JSONEncoder),
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
@dont_throw
|
|
81
|
+
def process_response(span, res):
|
|
82
|
+
if should_send_prompts():
|
|
83
|
+
span.set_attribute(
|
|
84
|
+
SpanAttributes.TRACELOOP_ENTITY_OUTPUT,
|
|
85
|
+
json.dumps(res, cls=JSONEncoder),
|
|
86
|
+
)
|
opentelemetry_instrumentation_llamaindex-0.25.1/opentelemetry/instrumentation/llamaindex/version.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.25.1"
|
|
@@ -8,7 +8,7 @@ show_missing = true
|
|
|
8
8
|
|
|
9
9
|
[tool.poetry]
|
|
10
10
|
name = "opentelemetry-instrumentation-llamaindex"
|
|
11
|
-
version = "0.25.
|
|
11
|
+
version = "0.25.1"
|
|
12
12
|
description = "OpenTelemetry LlamaIndex instrumentation"
|
|
13
13
|
authors = [
|
|
14
14
|
"Gal Kleinman <gal@traceloop.com>",
|
|
@@ -43,9 +43,9 @@ openai = "^1.35.0"
|
|
|
43
43
|
opentelemetry-sdk = "^1.23.0"
|
|
44
44
|
llama-index = "^0.10.46"
|
|
45
45
|
llama-index-postprocessor-cohere-rerank = "^0.1.7"
|
|
46
|
-
opentelemetry-instrumentation-openai = "==0.25.
|
|
47
|
-
opentelemetry-instrumentation-cohere = "==0.25.
|
|
48
|
-
opentelemetry-instrumentation-chromadb = "==0.25.
|
|
46
|
+
opentelemetry-instrumentation-openai = "==0.25.1"
|
|
47
|
+
opentelemetry-instrumentation-cohere = "==0.25.1"
|
|
48
|
+
opentelemetry-instrumentation-chromadb = "==0.25.1"
|
|
49
49
|
sqlalchemy = "^2.0.31"
|
|
50
50
|
llama-index-agent-openai = ">=0.2.7,<0.3.0"
|
|
51
51
|
llama-index-vector-stores-chroma = "^0.1.9"
|
opentelemetry_instrumentation_llamaindex-0.25.0/opentelemetry/instrumentation/llamaindex/version.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.25.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|