Repository navigation
Count and trace tool calls made by native agent frameworks - #73901
Merged
kaxil merged 1 commit intoSep 30, 2026
Merged
Conversation
kaxil
marked this pull request as ready for review
September 29, 2026 13:18
kaxil
requested review from
Lee-W,
amoghrajesh,
ashb,
gopidesupavan and
potiuk
as code owners
September 29, 2026 13:18
kaxil
force-pushed
the
commonai-native-observability
branch
from
September 29, 2026 14:03
f629add to
79eac1c
Compare
vatsrahul1001
approved these changes
Sep 29, 2026
kaxil
force-pushed
the
commonai-native-observability
branch
from
September 29, 2026 20:07
79eac1c to
c838fac
Compare
Every call to a toolset this provider ships increments common_ai.tool_calls, tagged with the toolset class, the agent framework making the call (pydantic_ai, strands, adk, langchain or none) and the outcome (executed, failed or replayed). agent_framework_tracing() wraps the code that builds and runs a Strands or Google ADK agent. Inside it the framework leaves prompts, completions and tool inputs and outputs out of its spans unless [common.ai] capture_content is on, spans carry the task's identity like AgentOperator's, and with worker tracing off the Dag run's unsampled trace context no longer drops the framework's spans.
kaxil
force-pushed
the
commonai-native-observability
branch
from
September 30, 2026 06:01
c838fac to
b053ff0
Compare
This was referenced Oct 8, 2026
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.
A Strands or ADK agent running in a plain Python task was invisible in Airflow's metrics and its traces: nothing counted its tool calls, its spans carried prompts and tool results by default, and they were not tied to the task.
common_ai.tool_callsis incremented for every call to a connection-backed toolset this provider ships, tagged with the toolset class, the framework making the call (pydantic_ai,strands,adk,langchainornone) and the outcome (executed,failedorreplayed). Tags stay low-cardinality: never arguments, connection IDs, table names or paths.agent_framework_tracing()wraps the code that builds and runs the agent. Inside the block, three things hold:[common.ai] otel_export_enabledandcapture_contentare both on, the same default asAgentOperator.The frameworks read their content switches only from the environment, so the helper sets them for the duration of the block. Blocks can overlap when a task runs agents in threads, so the switches stay set until the last one closes. A task runs in its own process, so nothing outside the task sees them.
The helper detaches the parent only when the current span is the Dag run's propagated context itself. That happens only when no tracer provider made a task span. When core tracing or auto-instrumentation made one, the Dag run was sampled out on purpose, and the helper leaves that decision alone. This is the same rule as #73903, which changes the task span itself; the helper covers Airflow versions without that fix. The metric and the helper are experimental and listed on the stability page.
ADK and Strands spans nested under their task spans, and a Strands tool span carrying the task's identity:
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.