Repository navigation
feat!: report template insights session usage per app - #29796
Merged
Merged
Conversation
EhabY
force-pushed
the
ehab/client-642-per-app-template-insights
branch
3 times, most recently
from
September 24, 2026 16:55
9667748 to
362e1f8
Compare
This was referenced Sep 29, 2026
EhabY
force-pushed
the
ehab/client-642-per-app-template-insights
branch
from
October 7, 2026 13:51
362e1f8 to
dbeb2fd
Compare
EhabY
added this pull request to stack #30468
October 7, 2026 13:59
EhabY
force-pushed
the
ehab/client-642-per-app-template-insights
branch
from
October 7, 2026 17:32
dbeb2fd to
80e7966
Compare
EhabY
force-pushed
the
ehab/client-642-per-app-template-insights
branch
from
October 8, 2026 09:06
80e7966 to
a9361ac
Compare
EhabY
removed this pull request from stack #30468
October 8, 2026 09:15
EhabY
added this pull request to stack #30499
October 8, 2026 09:16
EhabY
force-pushed
the
ehab/client-642-per-app-template-insights
branch
from
October 8, 2026 15:45
a9361ac to
75ac922
Compare
EhabY
force-pushed
the
ehab/client-642-per-app-template-insights
branch
from
October 8, 2026 15:59
75ac922 to
29dfcdf
Compare
EhabY
force-pushed
the
ehab/client-642-per-app-template-insights
branch
from
October 8, 2026 16:00
29dfcdf to
ce68dce
Compare
EhabY
force-pushed
the
ehab/client-642-per-app-template-insights
branch
from
October 8, 2026 16:25
ce68dce to
13e5b01
Compare
2 tasks
EhabY
force-pushed
the
ehab/client-642-per-app-template-insights
branch
2 times, most recently
from
October 12, 2026 13:20
9f3ca07 to
b46e52a
Compare
EhabY
force-pushed
the
ehab/client-642-per-app-template-insights
branch
from
October 12, 2026 13:58
b46e52a to
6ced729
Compare
EhabY
force-pushed
the
ehab/client-642-per-app-template-insights
branch
from
October 12, 2026 21:09
6ced729 to
f87b2ad
Compare
9 tasks done
EhabY
force-pushed
the
ehab/client-642-per-app-template-insights
branch
from
October 13, 2026 15:59
f87b2ad to
59ed4a3
Compare
EhabY
marked this pull request as ready for review
October 13, 2026 16:02
1 of 3 tasks
EhabY
force-pushed
the
ehab/client-642-per-app-template-insights
branch
from
October 13, 2026 17:28
59ed4a3 to
39a27bd
Compare
code-asher
reviewed
Oct 16, 2026
code-asher
left a comment
Member
There was a problem hiding this comment.
Been trying it out and it is looking good!
EhabY
force-pushed
the
ehab/client-642-per-app-template-insights
branch
from
October 16, 2026 19:17
f8c7ada to
8b72baa
Compare
code-asher
approved these changes
Oct 19, 2026
1 task
Remove the family field and AppFamilyWorkspaceApp from TemplateAppUsage, rename the session and template app variables in convertTemplateInsightsApps, and simplify the accounting row tooltips.
EhabY
force-pushed
the
ehab/client-642-per-app-template-insights
branch
2 times, most recently
from
October 19, 2026 09:58
5a93e5f to
4185c58
Compare
EhabY
force-pushed
the
ehab/client-642-per-app-template-insights
branch
from
October 19, 2026 10:45
4185c58 to
0da5d0b
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
Report template insights session usage per app instead of five fixed family rows. Apps with usage use registry names and icons (VS Code, Cursor, GoLand, Zed, etc.). Rows carry no app family. Template-defined workspace apps retain their existing accounting and report
method: workspace_app.The API adds
usage_total_seconds, counting each user's active minutes once. UI bars use that total rather than summed app time, so overlapping apps can add up to more than 100%. Missing icons have a fallback; accounting rows have explanatory tooltips.Implements the API/UI portion of the Completing Scalable IDE Session Tracking RFC. No migrations or ingestion changes. Prometheus metrics are handled separately in #29906. Targets
main; #30497 is merged. Part of CLIENT-642.Breaking changes
For
GET /api/v2/insights/templates(report.apps_usage):type(builtin/app) is replaced bymethod(connection_log_methodvalues):ssh,reconnecting_pty, orport_forwardingfor session apps,workspace_appfor template apps. Session methods are derived from the app name until Record the connection method for session app usage #31012 stores them.reconnecting-ptytoreconnecting_pty.unknownoroverflow("Other apps").codersdk.UnionByFamilyhelper.Consumers relying on the fixed five rows, family slugs, or previous display names must update.
Before/after JSON example
Same usage in both responses: one user is active for 10 minutes, using VS Code for 10 minutes, Cursor for 5 minutes, and Web Terminal for 1 minute. Cursor and Web Terminal overlap with VS Code. These are response excerpts; unchanged report/app metadata and interval reports are omitted.
Before: Cursor is included in the VS Code family total, and unused built-ins are still returned.
{ "report": { "active_users": 1, "apps_usage": [ { "slug": "vscode", "display_name": "Visual Studio Code", "seconds": 900 }, { "slug": "jetbrains", "display_name": "JetBrains", "seconds": 0 }, { "slug": "reconnecting-pty", "display_name": "Web Terminal", "seconds": 60 }, { "slug": "ssh", "display_name": "SSH", "seconds": 0 }, { "slug": "sftp", "display_name": "SFTP", "seconds": 0 } ] } }After: Each used app has its own row; the active-time total remains 600 seconds despite overlapping app usage.
{ "report": { "active_users": 1, "usage_total_seconds": 600, "apps_usage": [ { "slug": "cursor", "method": "ssh", "display_name": "Cursor", "seconds": 300 }, { "slug": "reconnecting_pty", "method": "reconnecting_pty", "display_name": "Web Terminal", "seconds": 60 }, { "slug": "vscode", "method": "ssh", "display_name": "VS Code", "seconds": 600 } ] } }Response cap
Registered apps with usage and accounting rows are exempt from the response limit. The 64 busiest unregistered names are listed individually; the rest fold into "Other apps". Folded minutes are summed per user and half hour, then capped at that user's active minutes. Because app overlap is not stored, folded overflow sets
seconds_is_upper_boundand the UI labels it "Up to". Stored overflow remains exact when no apps fold. The cap shapes only the response, not storage or scans.Refactoring plan and verification evidence
The approved cleanup preserves behavior and the optimized single-/multi-template aggregation:
The final query matched the original PR query in 2,412 deterministic/randomized cases. Database/SDK suites passed 2,846 tests; targeted backend suites passed 46 tests. Frontend utility tests, five Storybook stories, generation, repository lint, and type checks passed.
PostgreSQL 18.6 synthetic benchmarks, seven alternating rounds, median
EXPLAIN ANALYZEexecution time:Scan counts, buffer hits, and spill sizes did not increase; no-fold overflow scans executed zero times. Timing was noisy: the single-template uninstrumented wall-time median was 522.08 → 518.56 ms. These measurements are query benchmarks, not endpoint latency or a production-performance guarantee.
Generated with Coder Agents on behalf of @EhabY.