Skip to content

Commit 45b3dae

Browse files
change to function_id
1 parent 339eba1 commit 45b3dae

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

sentry_sdk/integrations/langchain.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@ def new_invoke(self: "Any", *args: "Any", **kwargs: "Any") -> "Any":
975975
origin=LangchainIntegration.origin,
976976
) as span:
977977
if run_name:
978-
span.set_data(SPANDATA.GEN_AI_PIPELINE_NAME, run_name)
978+
span.set_data(SPANDATA.GEN_AI_FUNCTION_ID, run_name)
979979

980980
span.set_data(SPANDATA.GEN_AI_OPERATION_NAME, "invoke_agent")
981981
span.set_data(SPANDATA.GEN_AI_RESPONSE_STREAMING, False)
@@ -1035,7 +1035,7 @@ def new_stream(self: "Any", *args: "Any", **kwargs: "Any") -> "Any":
10351035
span.__enter__()
10361036

10371037
if run_name:
1038-
span.set_data(SPANDATA.GEN_AI_PIPELINE_NAME, run_name)
1038+
span.set_data(SPANDATA.GEN_AI_FUNCTION_ID, run_name)
10391039

10401040
span.set_data(SPANDATA.GEN_AI_OPERATION_NAME, "invoke_agent")
10411041
span.set_data(SPANDATA.GEN_AI_RESPONSE_STREAMING, True)

tests/integrations/langchain/test_langchain.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ def test_langchain_openai_tools_agent(
655655
assert chat_spans[1]["origin"] == "auto.ai.langchain"
656656
assert tool_exec_span["origin"] == "auto.ai.langchain"
657657

658-
assert invoke_agent_span["data"]["gen_ai.pipeline.name"] == "my-snazzy-pipeline"
658+
assert invoke_agent_span["data"]["gen_ai.function_id"] == "my-snazzy-pipeline"
659659

660660
# We can't guarantee anything about the "shape" of the langchain execution graph
661661
assert len(list(x for x in tx["spans"] if x["op"] == "gen_ai.chat")) > 0
@@ -858,7 +858,7 @@ def test_langchain_openai_tools_agent_with_config(
858858
assert chat_spans[1]["origin"] == "auto.ai.langchain"
859859
assert tool_exec_span["origin"] == "auto.ai.langchain"
860860

861-
assert invoke_agent_span["data"]["gen_ai.pipeline.name"] == "my-snazzy-pipeline"
861+
assert invoke_agent_span["data"]["gen_ai.function_id"] == "my-snazzy-pipeline"
862862

863863
# We can't guarantee anything about the "shape" of the langchain execution graph
864864
assert len(list(x for x in tx["spans"] if x["op"] == "gen_ai.chat")) > 0
@@ -1060,7 +1060,7 @@ def test_langchain_openai_tools_agent_stream(
10601060
assert chat_spans[1]["origin"] == "auto.ai.langchain"
10611061
assert tool_exec_span["origin"] == "auto.ai.langchain"
10621062

1063-
assert invoke_agent_span["data"]["gen_ai.pipeline.name"] == "my-snazzy-pipeline"
1063+
assert invoke_agent_span["data"]["gen_ai.function_id"] == "my-snazzy-pipeline"
10641064

10651065
# We can't guarantee anything about the "shape" of the langchain execution graph
10661066
assert len(list(x for x in tx["spans"] if x["op"] == "gen_ai.chat")) > 0
@@ -1263,7 +1263,7 @@ def test_langchain_openai_tools_agent_stream_with_config(
12631263
assert chat_spans[1]["origin"] == "auto.ai.langchain"
12641264
assert tool_exec_span["origin"] == "auto.ai.langchain"
12651265

1266-
assert invoke_agent_span["data"]["gen_ai.pipeline.name"] == "my-snazzy-pipeline"
1266+
assert invoke_agent_span["data"]["gen_ai.function_id"] == "my-snazzy-pipeline"
12671267

12681268
# We can't guarantee anything about the "shape" of the langchain execution graph
12691269
assert len(list(x for x in tx["spans"] if x["op"] == "gen_ai.chat")) > 0

0 commit comments

Comments
 (0)