You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MCP trace breakdown reports top-N shares as shares of all matching child time #3763
I’m doing some research for Tessl Code Review and ran it against your repo. It flagged a potential issue, and I figured it made sense to share it with you:
In clickstack_trace_breakdown, changing topN changes both grandTotalTimeMs and each operation's shareOfTotalTime, even when the matching traces stay the same.
For two matching child operations, A = 60 ms and B = 40 ms, I ran the actual registered handler at ef81fe6d84b07c304888cd999f5e840fb050d05f with a stubbed ClickHouse client returning the requested top-N rows:
topN
grandTotalTimeMs
A.shareOfTotalTime
1
60
1
2
100
0.6
The handler's generated query contains LIMIT {topN:UInt32}. With topN=1, the response therefore describes A as 100% of total child time, even though B accounts for 40% in the fixture.
Expected behavior
Either calculate the denominator across all matching operations before limiting the output, or describe/name these fields as totals and shares of the returned rows. Otherwise an MCP consumer can interpret a truncated result as the complete cost breakdown.
Environment and validation
Current source commit: ef81fe6d84b07c304888cd999f5e840fb050d05f. This checks the real handler's response calculation with controlled query results; I did not run the SQL against a live ClickHouse instance. Reproduction on play.hyperdx.io: not attempted.
This was surfaced by an earlier review finding and is still present in the source checked above. Happy to share the harness or clarify anything.
Full transparency: I work at Tessl, and we've spotted that using Tessl Code Review - using repository-level context and specific review lenses that improve over time through feedback. That’s how this finding surfaced.
We’re just getting started and want to offer the tool free to open-source projects. If this is useful, happy to give you access.
Activity