refactor(agents): rename the graph span to launchdarkly.graph for consistency - #112
Merged
Merged
Conversation
The graph span carried ld.ai.graph.key while the invoke_agent root carried launchdarkly.graph.key, so one graph key had two attribute names. js-ai-sdk #16 fixed this in TypeScript by moving the graph span, its key and its path under launchdarkly., and keeping ld.ai. for metric and event keys. This makes the same rename in the three native_graph.py handlers so both SDKs emit the same names again: ld.ai.graph -> launchdarkly.graph ld.ai.graph.key -> launchdarkly.graph.key ld.ai.graph.path -> launchdarkly.graph.path The parity test's vocabulary lock and span-name pattern move with it. launchdarkly.graph.key was already in the lock as a root attribute, so it is listed once.
The span table, the conversation-id section and section 10 still named ld.ai.graph, and section 10 said to rename only if js-ai-sdk #16 merged. It has, so the contract now names launchdarkly.graph and says why the prefix changed. The span table pointed at section 8 for the graph span; it now points at section 10, where the graph span is described.
apucacao
marked this pull request as ready for review
September 25, 2026 15:29
andrewklatzke
approved these changes
Sep 25, 2026
donei003
added a commit
that referenced
this pull request
Sep 26, 2026
…trajectory into stream judges CI was failing the cross-handler vocabulary lock: graph().stream()'s root span and its key attribute regressed to ld.ai.graph / ld.ai.graph.key, the names main renamed away from in #112/b16dfda. Both call sites (invoke's and stream's span creation) are fixed, along with the one doc comment and test file that named the old span. Also two review findings (Devin + Cursor Bugbot) on the merge: stream_node and stream_route's multi-edge branch discarded the trajectory execute_and_stream now renders before calling run_judges, so a streamed graph node's judge saw no tool calls while the same node invoked without streaming did. Both now carry it through, matching run_node. Added regression tests for each path. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
js-ai-sdk#16 merged today and moved the graph span under the
launchdarkly.prefix. Before, the graph span carriedld.ai.graph.keywhile theinvoke_agentroot carriedlaunchdarkly.graph.key, so one graph key had two names.ld.ai.is where LaunchDarkly keeps metric and event keys, so it stays reserved for those. This PR makes the same rename in the three Pythonnative_graph.pyhandlers, so both SDKs emit the same span again:ld.ai.graphlaunchdarkly.graphld.ai.graph.keylaunchdarkly.graph.keyld.ai.graph.pathlaunchdarkly.graph.pathThis isn't a new convention. It brings the graph span in line with one both SDKs already follow. Every other LaunchDarkly-owned attribute the handlers write is already under
launchdarkly.:launchdarkly.operation.typelaunchdarkly.config.keylaunchdarkly.variation.keylaunchdarkly.run.idlaunchdarkly.graph.key(on theinvoke_agentroot)launchdarkly.run.cancelledlaunchdarkly.stream.abandonedThe graph span and its two attributes were the only LaunchDarkly-specific span names still under
ld.ai.. After this PR there are none in either SDK, and the rule is written down in js-ai-sdk'sAGENTS.md: anything LaunchDarkly owns that isn't an OTel semantic convention goes underlaunchdarkly., span names included.The contract doc already said to make this rename once #16 merged.
Nothing reads the old names.
gonfalonandobservabilityhave no references to any of them.Testing
uv run pyteston the parity test and the threetest_native_graph.pyfiles: 152 passed, 11 skipped.ruff checkandruff format --checkpass on the changed files.Original branch:
ag/rename-graph-spanNote
Overview
Aligns Python native graph telemetry with js-ai-sdk #16 by renaming graph OpenTelemetry spans and attributes from
ld.ai.graph/ld.ai.graph.key/ld.ai.graph.pathtolaunchdarkly.graph,launchdarkly.graph.key, andlaunchdarkly.graph.path.The same rename is applied in all three
native_graph.pyimplementations (claude-agents, langchain-agents, openai-agents).TELEMETRY-CONTRACT.mdis updated to document the new names and rationale (launchdarkly.for LD-owned span data;ld.ai.reserved for metrics/events). Tests andtests/test_cross_handler_parity.pyvocabulary lock / span-name regex are updated to match.$ld:ai:*metric/event keys are unchanged—only trace span names and attributes.Reviewed by Cursor Bugbot for commit 488717e. Bugbot is set up for automated code reviews on this repo. Configure here.