# Finding performance wins in our own traces with a coding agent

DevFeed: [Finding performance wins in our own traces with a coding agent](<https://devfeed.tech/articles/finding-performance-wins-in-our-own-traces-with-a-coding-agent-115871.md>)

Original publisher: [Read original article](<https://blog.sentry.io/performance-wins-traces-coding-agent/>)

Author: Scott Cooper

Published: 2026-11-03T09:00:00Z

Content type: news

Language: en

Sources: [Sentry](<https://devfeed.tech/sources/sentry-blog.md>)

Topics: [database-optimization](<https://devfeed.tech/topics/database-optimization.md>), [telemetry](<https://devfeed.tech/topics/telemetry.md>), [dogfooding](<https://devfeed.tech/topics/dogfooding.md>)

Tags: [agent](<https://devfeed.tech/tags/agent.md>), [backend](<https://devfeed.tech/tags/backend.md>), [coding](<https://devfeed.tech/tags/coding.md>), [coding-agent](<https://devfeed.tech/tags/coding-agent.md>), [mcp](<https://devfeed.tech/tags/mcp.md>), [performance](<https://devfeed.tech/tags/performance.md>), [queries](<https://devfeed.tech/tags/queries.md>), [sentry](<https://devfeed.tech/tags/sentry.md>), [traces](<https://devfeed.tech/tags/traces.md>)

## AI overview

Using Claude with Opus 5.5 and the Sentry MCP, the author ranked frequent, slow spans in Sentry's own traces, then investigated selected issues in code and git history before proposing small fixes as draft PRs. Django query spans, query-source attributes, and example trace links helped locate and review work. For SQL changes, the agent compared EXPLAIN ANALYZE results on a read-only database mirror. Reported wins included about 143 million fewer SELECTs per week from reusing loaded project data, a GroupHistory lookup reduced from 935 ms to 0.4 ms on a warm cache, and batched cache writes reduced from about 51 ms to 1.2 ms in a measured example. The author also checked request latency and database load, and says query-volume and daily-savings figures are estimates based on sampled spans and observed traffic.

## Source excerpt

How we used a coding agent and the Sentry MCP to find backend performance wins in Sentry's own traces and remove hundreds of millions of queries a week.