Skip to content

Commit 6edb2cb

Browse files
authored
Merge pull request #599 from UiPath/fix/remove-exporters-from-runtimes
Fix/remove exporters from runtimes
2 parents 5616bbf + d123dd0 commit 6edb2cb

5 files changed

Lines changed: 10 additions & 5 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath"
3-
version = "2.1.55"
3+
version = "2.1.56"
44
description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools."
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.10"

src/uipath/_cli/_runtime/_contracts.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from pydantic import BaseModel, Field
2525

2626
from uipath.agent.conversation import UiPathConversationEvent, UiPathConversationMessage
27-
from uipath.tracing import LlmOpsHttpExporter, TracingManager
27+
from uipath.tracing import TracingManager
2828

2929
from ._logging import LogsInterceptor
3030

@@ -698,8 +698,6 @@ def __init__(
698698
self.tracer_provider: TracerProvider = TracerProvider()
699699
self.tracer_span_processors: List[SpanProcessor] = []
700700
trace.set_tracer_provider(self.tracer_provider)
701-
if os.getenv("UIPATH_JOB_KEY"):
702-
self.add_span_exporter(LlmOpsHttpExporter())
703701

704702
def add_span_exporter(
705703
self,

src/uipath/_cli/cli_eval.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from uipath._cli._runtime._runtime import UiPathScriptRuntime
1515
from uipath._cli.middlewares import Middlewares
1616
from uipath.eval._helpers import auto_discover_entrypoint
17+
from uipath.tracing import LlmOpsHttpExporter
1718

1819
from .._utils.constants import ENV_JOB_ID
1920
from ..telemetry import track
@@ -108,6 +109,8 @@ def generate_runtime_context(**context_kwargs) -> UiPathRuntimeContext:
108109
UiPathRuntimeContext,
109110
context_generator=generate_runtime_context,
110111
)
112+
if not no_report or eval_context.job_id:
113+
runtime_factory.add_span_exporter(LlmOpsHttpExporter())
111114

112115
async def execute():
113116
async with UiPathEvalRuntime.from_eval_context(

src/uipath/_cli/cli_run.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import click
88

99
from uipath._cli._utils._debug import setup_debugging
10+
from uipath.tracing import LlmOpsHttpExporter
1011

1112
from .._utils.constants import (
1213
ENV_JOB_ID,
@@ -102,6 +103,7 @@ def run(
102103
runtime_factory = UiPathRuntimeFactory(
103104
UiPathScriptRuntime, UiPathRuntimeContext
104105
)
106+
105107
context = UiPathRuntimeContext.with_defaults(
106108
entrypoint=entrypoint,
107109
input=input,
@@ -110,6 +112,8 @@ def run(
110112
execution_output_file=output_file,
111113
debug=debug,
112114
)
115+
if context.job_id:
116+
runtime_factory.add_span_exporter(LlmOpsHttpExporter())
113117

114118
asyncio.run(runtime_factory.execute(context))
115119

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)