Skip to content

feat(langchain): Record run_name as gen_ai.function_id on Invoke Agent Spans#5926

Open
alexander-alderman-webb wants to merge 13 commits intowebb/langchain/split-out-testfrom
webb/langchain/agent-run-name
Open

feat(langchain): Record run_name as gen_ai.function_id on Invoke Agent Spans#5926
alexander-alderman-webb wants to merge 13 commits intowebb/langchain/split-out-testfrom
webb/langchain/agent-run-name

Conversation

@alexander-alderman-webb
Copy link
Copy Markdown
Contributor

@alexander-alderman-webb alexander-alderman-webb commented Apr 1, 2026

Description

Set run_name as the gen_ai.function_id attribute instead of gen_ai.agent.name.

Add tests for AgentExecutor.invoke() based on AgentExecutor.stream() test.
Add tests with create_openai_tools_agent().with_config() to test all branches for extracting the run_name.

Issues

Reminders

@alexander-alderman-webb alexander-alderman-webb changed the title feat(langchain): Record run_name as gen_ai.pipeline.name on Invoke Agent Spans feat(langchain): Record run_name as gen_ai.pipeline.name on Invoke Agent Spans Apr 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Langchain

  • Record run_name as gen_ai.function_id on Invoke Agent Spans by alexander-alderman-webb in #5926
  • Record run_name as gen_ai.function_id on Invoke Agent Spans by alexander-alderman-webb in #5926
  • Record run_name in on_chat_model_start by alexander-alderman-webb in #5924
  • Record run_name in on_tool_start by alexander-alderman-webb in #5925

Other

  • (ci) Cancel in-progress PR workflows on new commit push by joshuarli in #5994

Bug Fixes 🐛

  • (langchain) Set agent name as gen_ai.agent.name for chat and tool spans by alexander-alderman-webb in #5877

Internal Changes 🔧

  • (langchain) Separate test to remove conditional by alexander-alderman-webb in #6076

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Codecov Results 📊

31 passed | Total: 31 | Pass Rate: 100% | Execution Time: 18.83s

📊 Comparison with Base Branch

Metric Change
Total Tests 📉 -66
Passed Tests 📉 -54
Failed Tests
Skipped Tests 📉 -12

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 15470 uncovered lines.
✅ Project coverage is 27.27%. Comparing base (base) to head (head).

Files with missing lines (1)
File Patch % Lines
langchain.py 86.51% ⚠️ 80 Missing and 49 partials
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    26.04%    27.27%    +1.23%
==========================================
  Files          190       191        +1
  Lines        21358     21270       -88
  Branches      7066      7008       -58
==========================================
+ Hits          5562      5800      +238
- Misses       15796     15470      -326
- Partials       482       504       +22

Generated by Codecov Action

@alexander-alderman-webb alexander-alderman-webb marked this pull request as ready for review April 1, 2026 08:37
@alexander-alderman-webb alexander-alderman-webb requested a review from a team as a code owner April 1, 2026 08:37
@alexander-alderman-webb alexander-alderman-webb changed the title feat(langchain): Record run_name as gen_ai.pipeline.name on Invoke Agent Spans feat(langchain): Record run_name as gen_ai.function_id on Invoke Agent Spans Apr 14, 2026
Comment thread sentry_sdk/integrations/langchain.py
Comment thread tests/integrations/langchain/test_langchain.py
Comment thread tests/integrations/langchain/test_langchain.py Outdated
Comment thread tests/conftest.py Outdated
@alexander-alderman-webb alexander-alderman-webb changed the base branch from webb/langchain/tool-pipeline-name to webb/langchain/split-out-test April 15, 2026 07:43
Comment thread tests/integrations/langchain/test_langchain.py
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3c7adea. Configure here.

Comment thread tests/integrations/langchain/test_langchain.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants