Finding performance wins in our own traces with a coding agent
Blog post from Sentry
Using a coding agent connected to Sentry’s MCP and trace data, Sentry engineers identified and fixed numerous backend performance bottlenecks through mostly small code changes, collectively eliminating hundreds of millions of database queries per week and dramatically accelerating several expensive operations. The agent ranked high-volume and slow spans from Django instrumentation, cache calls, RPCs, tasks, and API routes, then investigated candidate fixes using source code, Git history, trace examples, and read-only database validation with EXPLAIN ANALYZE. Improvements included avoiding unnecessary repository pagination, removing duplicate queries, reusing loaded project data, eager-loading related objects, adding an index, batching cache writes, and restructuring a GroupHistory query to use existing indexes more effectively, reducing one warm-cache lookup from 935 ms to 0.4 ms. Reported results included lower database load, reduced disk reads, faster ingestion and issue-status updates, tens of millions fewer daily queries, and cache operations reduced from roughly 51 ms to 1.2 ms in one case. The approach emphasizes starting with broad natural-language prompts, narrowing to promising areas, assessing risks before edits, and validating performance changes against database plans and production metrics.
Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.