Tomas AlabesSoftware developerSource.ag
A Node.js agent loop on LangGraph with LangChain and the Anthropic SDK, traced with Datadog LLM Observability.
GitHub (DataDog/dd-trace-js), published Read the issue (opens GitHub (DataDog/dd-trace-js) in a new tab)
Observation
At Source.ag, LangChain and Anthropic spans for the same model call made Datadog's cost rollup overcount spend about 2.2 times.
- Takeaway
- Check that each model call produces one LLM span before trusting cost views, and turn off duplicate provider integrations under a framework.
- What happened
- With LLM Observability on, both the LangChain and the Anthropic integrations emitted an LLM span for each model call, nested one inside the other (GitHub issue, Jun 16, 2026). Datadog's cost rollup summed both layers, so the cost view did not deliver the team's real spend: it overcounted about 2.2 times, and the two spans disagreed on cache reads. The workaround was to turn the Anthropic integration off. Datadog closed the issue as completed in June 2026. A month later the same engineer found every MCP tool call captured twice, with the full payload stored on each span.
“…cost rollup sums both layers and overcounts spend (~2.2× in our case)…”
- Public engineering write-up (the developer's GitHub issue)
- Team metric reported
Deployment details
A Node.js agent loop on LangGraph with LangChain and the Anthropic SDK, traced with Datadog LLM Observability.
- Public engineering write-up (the developer's GitHub issue)
- Team metric reported
- Team
- Source.ag, the team's own agent application
- Workload
- An agent loop on LangGraph calling Anthropic models through LangChain
- Product version
- dd-trace 5.106.x on Node.js 22 with LLM Observability enabled
- Measurement
- Cost rollup overcounted spend about 2.2 times
In SignalsCounted once, as the developer's own issue. In the record









