Skip to content

Commit 349a4c5

Browse files
committed
tracing: add openllmetry
1 parent 7ba0554 commit 349a4c5

3 files changed

Lines changed: 46 additions & 1 deletion

File tree

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
[project]
22
name = "uipath-llamaindex"
3-
version = "0.0.6"
3+
version = "0.0.7"
44
description = "UiPath LlamaIndex SDK"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.10"
77
dependencies = [
88
"llama-index>=0.12.36",
9+
"opentelemetry-instrumentation-llamaindex>=0.40.7",
910
"uipath>=2.0.56",
1011
]
1112
classifiers = [

src/uipath_llamaindex/_cli/cli_run.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import asyncio
22
import logging
3+
from contextlib import suppress
34
from os import environ as env
45
from typing import Optional
56

67
from dotenv import load_dotenv
8+
from opentelemetry.instrumentation.llamaindex import LlamaIndexInstrumentor
79
from uipath._cli._runtime._contracts import UiPathTraceContext
810
from uipath._cli.middlewares import MiddlewareResult
11+
from uipath.tracing import get_trace_provider
912

1013
from ._runtime._context import UiPathLlamaIndexRuntimeContext
1114
from ._runtime._exception import UiPathLlamaIndexRuntimeError
@@ -30,6 +33,10 @@ def llamaindex_run_middleware(
3033
try:
3134

3235
async def execute():
36+
37+
with suppress(Exception):
38+
LlamaIndexInstrumentor().instrument(tracer_provider=get_trace_provider())
39+
3340
context = UiPathLlamaIndexRuntimeContext.from_config(
3441
env.get("UIPATH_CONFIG_PATH", "uipath.json")
3542
)

uv.lock

Lines changed: 37 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)