Skip to content

Commit 5c7453f

Browse files
committed
fix: add request id to span names
1 parent 17a24de commit 5c7453f

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

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-mcp"
3-
version = "0.0.24"
3+
version = "0.0.26"
44
description = "UiPath MCP SDK"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.10"

samples/mcp-server/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[project]
22
name = "mcp-server"
3-
version = "0.0.1"
3+
version = "0.0.3"
44
description = "Demo MCP Server"
55
authors = [{ name = "John Doe" }]
66
dependencies = [
77
"mcp>=1.6.0",
8-
"uipath-mcp>=0.0.1",
8+
"uipath-mcp==0.0.3",
99
]
1010
requires-python = ">=3.10"

src/uipath_mcp/_cli/_runtime/_runtime.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ async def execute(self) -> Optional[UiPathRuntimeResult]:
6363
root_span.set_attribute("session_id", self.server.session_id)
6464
root_span.set_attribute("command", self.server.command)
6565
root_span.set_attribute("args", self.server.args)
66-
root_span.set_attribute("type", self.server.type)
6766
self.signalr_client = SignalRClient(
6867
signalr_url,
6968
headers={

src/uipath_mcp/_cli/_runtime/_session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ async def send_outgoing_message(self, message: types.JSONRPCMessage) -> None:
189189
json=message.model_dump(),
190190
)
191191

192-
span.set_attribute("http.status_code", response.status_code)
192+
span.set_attribute("http_status_code", response.status_code)
193193

194194
if response.status_code == 202:
195195
logger.info(

src/uipath_mcp/_cli/_runtime/_tracer.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def create_span_for_message(
3636
root_value = message.root
3737

3838
if isinstance(root_value, types.JSONRPCRequest):
39-
span = self.tracer.start_span(root_value.method)
39+
span = self.tracer.start_span(f"{root_value.method} [{root_value.id}]")
4040
span.set_attribute("type", "request")
4141
span.set_attribute("id", str(root_value.id))
4242
span.set_attribute("method", root_value.method)
@@ -49,13 +49,13 @@ def create_span_for_message(
4949
self._add_notification_attributes(span, root_value)
5050

5151
elif isinstance(root_value, types.JSONRPCResponse):
52-
span = self.tracer.start_span("response")
52+
span = self.tracer.start_span(f"response [{root_value.id}]")
5353
span.set_attribute("type", "response")
5454
span.set_attribute("id", str(root_value.id))
5555
self._add_response_attributes(span, root_value)
5656

5757
elif isinstance(root_value, types.JSONRPCError):
58-
span = self.tracer.start_span("error")
58+
span = self.tracer.start_span(f"error [{root_value.id}]")
5959
span.set_attribute("type", "error")
6060
span.set_attribute("id", str(root_value.id))
6161
span.set_attribute("error_code", root_value.error.code)
@@ -83,6 +83,7 @@ def _add_request_attributes(
8383
if request.method == "tools/call" and isinstance(request.params, dict):
8484
if "name" in request.params:
8585
span.set_attribute("tool_name", request.params["name"])
86+
span.update_name(f"{request.method}/{request.params['name']} [{request.id}]")
8687
if "arguments" in request.params and isinstance(
8788
request.params["arguments"], dict
8889
):

0 commit comments

Comments
 (0)