Repository navigation
Conversation
Contributor
Docs previewCheck off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here. |
nickvigilante
added a commit
that referenced
this pull request
Oct 2, 2026
`coder port-forward` reported usage with the deprecated `UpdateWorkspaceUsageContext`. It now reports a `port_forwarding` session, like `coder ssh` and the VS Code SSH path, but only while a forwarded TCP connection is open. **Behavior change:** CLI output is unchanged. Port-forward sessions previously only bumped the workspace's last-used time. With the hidden `workspace-usage` experiment enabled, the server now also records `port_forwarding` session counts under a new `port_forwarding` family, which the deployment banner totals under **Other**. Without the experiment, `postWorkspaceUsage` returns 204 before reading the body, so nothing changes. <details> <summary>Decisions</summary> - Added `codersdk.UsageAppNamePortForwarding` (`port_forwarding`) rather than reusing `ssh`, so port-forwarding isn't counted as interactive SSH. The name matches the arbitrary app names RFC's connection-method name. - Registered a `port_forwarding` family in `codersdk/appname.go`. Families resolve at read time, so no data migration is needed. Template insights list apps individually; telemetry, metricscache, and agentstats gauges are legacy fixed fields and stay as they are. The Prometheus insights family is left to #29906. - Only TCP connections count. UDP forwards never see EOF, so one datagram would keep the session active until exit. - Reports once at startup, like the old call, then every minute and once on shutdown. An idle tick sends an empty body, which still bumps last-used. </details> Closes [CLI-31](https://linear.app/codercom/issue/CLI-31) _This PR was generated by Coder Agents on behalf of @nickvigilante._ <details> <summary>CI note: unrelated test-go-race-pg flake</summary> The `test-go-race-pg` job failed on a data race between `tailnet.(*configMaps).updatePeerLocked` and slog formatting of the same peer value, which does not touch port-forward code. The job was rerun. </details>
EhabY
force-pushed
the
ehab/vscode-family-label
branch
from
October 7, 2026 13:51
da188c4 to
6bdbd8c
Compare
EhabY
changed the base branch from
main
to
ehab/client-642-per-app-template-insights
October 7, 2026 13:51
EhabY
added this pull request to stack #30468
October 7, 2026 13:59
EhabY
marked this pull request as draft
October 7, 2026 13:59
EhabY
force-pushed
the
ehab/vscode-family-label
branch
from
October 7, 2026 17:32
6bdbd8c to
b35afa2
Compare
EhabY
removed this pull request from stack #30468
October 8, 2026 09:15
EhabY
force-pushed
the
ehab/vscode-family-label
branch
from
October 8, 2026 09:16
b35afa2 to
14839f0
Compare
EhabY
added this pull request to stack #30499
October 8, 2026 09:16
EhabY
force-pushed
the
ehab/vscode-family-label
branch
from
October 8, 2026 15:45
14839f0 to
4d31a5d
Compare
EhabY
force-pushed
the
ehab/vscode-family-label
branch
2 times, most recently
from
October 8, 2026 16:00
e363467 to
62b1f30
Compare
EhabY
force-pushed
the
ehab/vscode-family-label
branch
from
October 8, 2026 16:25
62b1f30 to
77ef278
Compare
2 tasks
nickvigilante
left a comment
Contributor
There was a problem hiding this comment.
Docs LGTM! One small nit
EhabY
force-pushed
the
ehab/vscode-family-label
branch
from
October 16, 2026 19:22
60237b8 to
f1d8041
Compare
EhabY
force-pushed
the
ehab/vscode-family-label
branch
from
October 17, 2026 11:46
90bc72b to
e9c73dd
Compare
1 task
EhabY
force-pushed
the
ehab/vscode-family-label
branch
from
October 19, 2026 10:29
e9c73dd to
3ae4ca4
Compare
EhabY
force-pushed
the
ehab/vscode-family-label
branch
from
October 19, 2026 10:46
3ae4ca4 to
7afe77c
Compare
Base automatically changed from
ehab/client-642-per-app-template-insights
to
main
October 19, 2026 14:59
EhabY
added a commit
that referenced
this pull request
Oct 19, 2026
Report template insights session usage per app instead of five fixed family rows, with registry names and icons. - Add per-app rows for reported session apps (VS Code, Cursor, GoLand, Zed, etc.); unused apps are omitted - Replace `type` (`builtin`/`app`) with `method` (`ssh`, `reconnecting_pty`, `port_forwarding`, `workspace_app`); session methods are derived from the app name until #31012 stores them - Add `usage_total_seconds` to count each user's active minutes once, and use it as the UI bar denominator so overlapping apps can exceed 100% - Merge template apps sharing a slug into one row across templates, using the newest display name and icon - Rename Web Terminal slug from `reconnecting-pty` to `reconnecting_pty` - Cap the response at the 64 busiest unregistered apps and fold the rest into "Other apps", flagged with `seconds_is_upper_bound` ("Up to" in the UI) - Add `unknown` and `overflow` accounting rows with explanatory tooltips, and a fallback icon for apps without one - Remove the unused `codersdk.UnionByFamily` helper from the Go SDK BREAKING CHANGE: `report.apps_usage` in `GET /api/v2/insights/templates` no longer returns the fixed five rows, family slugs, or previous display names. Consumers must update. Part of CLIENT-642 Prometheus metrics handled separately in #29906
EhabY
force-pushed
the
ehab/vscode-family-label
branch
from
October 19, 2026 14:59
7afe77c to
d06ce5c
Compare
EhabY
removed this pull request from stack #30499
October 19, 2026 20:00
EhabY
force-pushed
the
ehab/vscode-family-label
branch
from
October 19, 2026 20:15
263cbb0 to
3b30952
Compare
EhabY
added this pull request to stack #31031
October 19, 2026 21:32
EhabY
force-pushed
the
ehab/vscode-family-label
branch
2 times, most recently
from
October 19, 2026 22:51
7ac063d to
30c6158
Compare
EhabY
force-pushed
the
ehab/vscode-family-label
branch
from
October 19, 2026 22:56
30c6158 to
128abb6
Compare
The session banner labels the VS Code family as VS Code Family, using display names generated from the shared Go table. coderd_insights_applications_usage_seconds reports built-in apps per app instead of per family. A new connection_method label (workspace_app, ssh, reconnecting_pty, port_forwarding) separates template apps from built-in apps, matching the method and slug key of the template insights API, and built-in apps report the method stored by the previous commit. application_name is renamed to display_name so old selectors return nothing instead of silently matching one app. Each template reports registered apps and the 64 busiest other (method, app) pairs, like the template insights API; the rest add up under the overflow series of their method. Closes #29940
EhabY
force-pushed
the
ehab/vscode-family-label
branch
from
October 20, 2026 00:00
128abb6 to
5ba96c1
Compare
This branch has not been deployed
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Two breaking changes:
The session banner labels the VS Code family as VS Code Family, so it isn't confused with the VS Code editor. Family labels are generated from the shared Go table.
coderd_insights_applications_usage_secondsreports built-in apps per app instead of per family, gets aconnection_methodlabel, and renamesapplication_nametodisplay_name:connection_methodslugdisplay_nameworkspace_appssh,reconnecting_pty,port_forwardingcursorCursor; the app name if unregisteredconnection_method+slugis the row key ofGET /api/v2/insights/templates, so a template app with slugvscodestays separate from the VS Code desktop app. Built-in apps report the method stored by #31028, so the same app name under two methods gets two series.Each app counts its own minutes. A family total only differs from the sum of its apps when two apps of one family are open at once; dogfood connection logs showed no such overlap.
Note
A per-template total without overlap, such as
coderd_insights_session_usage_seconds{template_name, organization_name}, is additive and costs about 2 to 7% more query time. Left out until someone needs it.Closes #29940
Closes CLIENT-1034
Closes CLIENT-1036
Important
Stacked on #31028. Merge that first, then retarget this PR to
main.Size
Against #31028:
RFC status
Important
Land only after the RFC amendment is approved. Its unapproved sentences are marked ⏳.
slug=""family series (breaking, with migration docs)connection_method;application_namerenamed todisplay_nameSeries limit
Same rule as the template insights API: registered apps,
unknown, andoverflowalways get a series, plus the 64 busiest other (method, app) pairs per template. The rest add up under theoverflowseries of their method. Series exist only for apps used in the window.Upgrade impact
application_name, or withslug="", return nothing.slugalso match a built-in app with the same name (e.g.vscode). Addconnection_method="workspace_app".slugselector now include every built-in app, includingport_forwarding,sftp, andunknown.The docs map each old series to its new one.
Performance
Prometheus runs this query every tick over a fixed 5-minute window. Medians of interleaved
EXPLAIN (ANALYZE)rounds, local Postgres 13, 2,000 agents, 5M agent stat rows:mainThe extra time is the method level. The query looks up each
connection_log_methodthe row has (session_counts ? method) instead of expanding the object withjsonb_each. That keeps the planner's estimate under the JIT threshold, and it stays under it with larger windows (tested up to 120 minutes, which stands in for bigger deployments).Decision log
connection_method, not a separatecoderd_insights_session_apps_usage_seconds. Matches the API'smethod+slugkey.connection_method, notmethod. Same name as the database enum and connection logs;methodalone is vague.application_nametodisplay_name. Registry namesJetBrainsandSSHequal the old family labels, so keeping the label would make old selectors silently match one app. The rename makes them return nothing, and matches the API field name.display_nameholds the registry name for built-in apps, not a copy ofslug.sessionAppMethodguess and rewrote the same query. Stacking lets the metric read the stored method instead of guessing it, and drops the temporarycodersdk.SessionAppConnectionMethod.GetTemplateInsightsByTemplatenow returns{method: {app: seconds}}, andcapSessionAppslimits (method, app) pairs with one overflow per method, matchingGetTemplateInsights.enum_range(NULL::connection_log_method), filtered by?, notjsonb_each. Same result, without the row overestimate that turned on JIT.capSessionAppsedits the decoded map in place and only sorts when a template has more than 64 unregistered pairs.Generated with Coder Agents on behalf of @EhabY.