Skip to content

Conversation

shellmayr
Copy link
Member

@shellmayr shellmayr commented Aug 29, 2025

  • Add LangGraph integration
  • Compilation of StateGraphs results in an agent creation span (according to OTEL semantic conventions)
  • Runtime executions are done on Pregel instances - we are wrapping their invoke & ainvoke which produces the invoke_agent spans
  • There's some internals that automatically switch between invoke & stream on CompiledStateGraph (which is a subclass of Pregel), which results in duplicate spans if both are instrumented. For now, only invoke is wrapped to prevent this duplication.
  • Agent handoffs in LangGraph are done via tools - so there is no real possibility to create handoff spans within the SDK. Looks like this will be handled in product logic instead.

Closes TET-991
Closes PY-1799

Copy link

linear bot commented Aug 29, 2025

Copy link

codecov bot commented Aug 29, 2025

Codecov Report

❌ Patch coverage is 76.75676% with 43 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.75%. Comparing base (c378c2d) to head (f903562).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
sentry_sdk/integrations/langgraph.py 76.63% 18 Missing and 25 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #4727       +/-   ##
===========================================
+ Coverage   73.15%   84.75%   +11.60%     
===========================================
  Files         157      158        +1     
  Lines       16138    16323      +185     
  Branches     2744     2792       +48     
===========================================
+ Hits        11805    13835     +2030     
+ Misses       3640     1672     -1968     
- Partials      693      816      +123     
Files with missing lines Coverage Δ
sentry_sdk/consts.py 99.33% <100.00%> (+<0.01%) ⬆️
sentry_sdk/integrations/__init__.py 87.01% <ø> (ø)
sentry_sdk/integrations/langgraph.py 76.63% <76.63%> (ø)

... and 40 files with indirect coverage changes

Copy link

linear bot commented Sep 1, 2025

@shellmayr shellmayr force-pushed the shellmayr/feat/langgraph-integration branch from b070632 to b5c6e37 Compare September 3, 2025 13:43
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@antonpirker antonpirker changed the title feat: add langgraph integration feat: Add langgraph integration Sep 4, 2025
@antonpirker antonpirker changed the title feat: Add langgraph integration feat: Add LangGraph integration Sep 4, 2025
Copy link
Member

@antonpirker antonpirker left a comment

Choose a reason for hiding this comment

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

Now its ready to be merge. Thanks for the great work @shellmayr !

@antonpirker antonpirker merged commit 58a9827 into master Sep 4, 2025
134 checks passed
@antonpirker antonpirker deleted the shellmayr/feat/langgraph-integration branch September 4, 2025 13:38
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.

3 participants