René's URL Explorer Experiment


Title: Record the connection method for session app usage · Issue #31012 · coder/coder · GitHub

Open Graph Title: Record the connection method for session app usage · Issue #31012 · coder/coder

X Title: Record the connection method for session app usage · Issue #31012 · coder/coder

Description: Follow-up to #29796 (review thread). Problem Template insights reports each session app with a method (connection_log_method values). #29796 derives it at read time because session usage is stored per app name only: Stats.session_counts ...

Open Graph Description: Follow-up to #29796 (review thread). Problem Template insights reports each session app with a method (connection_log_method values). #29796 derives it at read time because session usage is stored ...

X Description: Follow-up to #29796 (review thread). Problem Template insights reports each session app with a method (connection_log_method values). #29796 derives it at read time because session usage is stored ...

Opengraph URL: https://github.com/coder/coder/issues/31012

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Record the connection method for session app usage","articleBody":"Follow-up to coder/coder#29796 ([review thread](\u003chttps://github.com/coder/coder/pull/29796#discussion_r4309702858>)).\n\n## Problem\n\nTemplate insights reports each session app with a `method` (`connection_log_method` values). coder/coder#29796 derives it at read time because session usage is stored per app name only: `Stats.session_counts` (agent proto) -> `workspace_agent_stats.session_counts` -> `template_usage_stats_session_apps(start_time, user_id, template_id, app_name, usage_mins)`.\n\nDerivation rule: app name `reconnecting_pty` -> `reconnecting_pty`, `port_forwarding` -> `port_forwarding`, any other session app -> `ssh`, template apps -> `workspace_app`. It is wrong whenever a client picks a name that does not match how it connected.\n\nSession counts have two sources:\n\n* The agent's `Stats.session_counts`, from its SSH and web terminal servers.\n* `POST /workspaces/{id}/usage` (`coderd/workspaces.go`), which turns the client-chosen `app_name` into `session_counts` directly. `coder port-forward` reports `port_forwarding`, `coder ssh --usage-app` any name (default `ssh`), `coder vscodessh` `vscode`, and `coder exp rpty` `reconnecting_pty`.\n\n## Scope (database only)\n\nStore the connection method of each session app. The agent protocol, the `/usage` endpoint, the CLI and the HTTP API do not change. Each current reporter uses an app name that matches its method, so coderd derives the method once, at ingest: `reconnecting_pty` → `reconnecting_pty`, `port_forwarding` → `port_forwarding`, everything else → `ssh`.\n\n* Migration: add `method connection_log_method NOT NULL` to `template_usage_stats_session_apps`, fill in existing rows with the rule above, add `method` to the primary key, and allow only `ssh`, `reconnecting_pty` and `port_forwarding`. The down migration adds each app's minutes across methods, capped at 30 per bucket.\n* Store `workspace_agent_stats.session_counts` as `{method: {app: count}}`.\n* The rollup and template insights group by (method, app). Apps past the limit fold into one `overflow` row per method.\n* Prometheus uses the stored method through coder/coder#29906, which is stacked on this PR. Telemetry and metricscache add up all methods, so their output does not change.\n\n## Out of scope\n\nA method field in the agent protocol and in `PostWorkspaceUsageRequest`. The first reporter whose app name does not match its method adds it (see the port-forward counting follow-up, [CLIENT-1053](https://linear.app/codercom/issue/CLIENT-1053/count-port-forwards-as-session-apps-per-method)).\n\n## Done when\n\n- [ ] coder/coder#31028 is merged.\n\nPart of coder/coder#27413.\n\n*Generated with Coder Agents on behalf of @EhabY.*\n\nScope narrowed to database-only storage by Coder Agents on behalf of @EhabY.","author":{"url":"https://github.com/EhabY","@type":"Person","name":"EhabY"},"datePublished":"2026-10-19T09:26:21Z","url":"https://github.com/coder/coder/issues/31012"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:4eace5d3-c3d2-3036-1b1a-03d7f079b245
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAC22:2E124E:1C80BF1:245C7C3:6B0160CD
html-safe-nonce4fe1c1b9b112c66260ed16a79bd4fece43ae9a1276140e1d8998c1911d5554c4
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQzIyOjJFMTI0RToxQzgwQkYxOjI0NUM3QzM6NkIwMTYwQ0QiLCJ2aXNpdG9yX2lkIjoiMzU0OTUxNTkxMDgzNzI5MTAxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac0a24f88f2bea87262f16c4ae624603cf332bd2db31b063d2096c12800021bc8c
hovercard-subject-tagissue:5921287386
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/coder/31012/issue_layout
twitter:imagehttps://opengraph.githubassets.com/85e10661bb5ccb6e3948d7b9d870c3b124fa4636a4d762454f4ff5f513d11e18/coder/coder/issues/31012
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/85e10661bb5ccb6e3948d7b9d870c3b124fa4636a4d762454f4ff5f513d11e18/coder/coder/issues/31012
og:image:altFollow-up to #29796 (review thread). Problem Template insights reports each session app with a method (connection_log_method values). #29796 derives it at read time because session usage is stored ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameEhabY
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/coder/coder git https://github.com/coder/coder.git
octolytics-dimension-user_id95932066
octolytics-dimension-user_logincoder
octolytics-dimension-repository_id440752086
octolytics-dimension-repository_nwocoder/coder
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id440752086
octolytics-dimension-repository_network_root_nwocoder/coder
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/coder/coder/issues/31012#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcoder%2Fcoder%2Fissues%2F31012
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcoder%2Fcoder%2Fissues%2F31012
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=coder%2Fcoder
Reloadhttps://github.com/coder/coder/issues/31012
Reloadhttps://github.com/coder/coder/issues/31012
Reloadhttps://github.com/coder/coder/issues/31012
coderhttps://github.com/coder
coderhttps://github.com/coder/coder
Codehttps://github.com/coder/coder
Issues320 (320)https://github.com/coder/coder/issues
Pull requests470 (470)https://github.com/coder/coder/pulls
Discussionshttps://github.com/coder/coder/discussions
Actionshttps://github.com/coder/coder/actions
Projectshttps://github.com/coder/coder/projects
Security and quality49 (49)https://github.com/coder/coder/security
Insightshttps://github.com/coder/coder/insights
https://github.com/coder/coder
New issuehttps://github.com/login?return_to=https://github.com/coder/coder/issues/31012
New issuehttps://github.com/login?return_to=https://github.com/coder/coder/issues/31012
Record the connection method for session app usagehttps://github.com/coder/coder/issues/31012#top
https://github.com/EhabY
https://github.com/EhabY
EhabYhttps://github.com/EhabY
on Oct 19, 2026https://github.com/coder/coder/issues/31012#issue-5921287386
#29796https://github.com/coder/coder/pull/29796
review threadhttps://github.com/coder/coder/pull/29796#discussion_r4309702858
#29796https://github.com/coder/coder/pull/29796
feat!: label the VS Code family and report built-in app usage per app #29906https://github.com/coder/coder/pull/29906
CLIENT-1053https://linear.app/codercom/issue/CLIENT-1053/count-port-forwards-as-session-apps-per-method
refactor: share the session app fold rule and method derivation #31028https://github.com/coder/coder/pull/31028
#27413https://github.com/coder/coder/issues/27413
@EhabYhttps://github.com/EhabY
@EhabYhttps://github.com/EhabY
EhabYhttps://github.com/EhabY
on Oct 19, 2026https://github.com/coder/coder/issues/31012#event-33629118350
https://github.com/apps/linear-code
linear-codehttps://github.com/apps/linear-code
on Oct 19, 2026https://github.com/coder/coder/issues/31012#issuecomment-6264014351
Linear Codehttps://linear.app
ENG-3474https://linear.app/codercom/issue/ENG-3474
EhabYhttps://github.com/EhabY
on Oct 19, 2026https://github.com/coder/coder/issues/31012#event-33656594976
feat!: report template insights session usage per app (#29796)https://github.com/coder/coder/commit/f4cd0deccb3d661c6345c6c5e7a5fc7f97576696
#29796https://github.com/coder/coder/pull/29796
f4cd0dehttps://github.com/coder/coder/commit/f4cd0deccb3d661c6345c6c5e7a5fc7f97576696
feat: record the connection method for session app usagehttps://github.com/coder/coder/commit/078f91c4e473c92a5271d8101b212aa1da213e13
078f91chttps://github.com/coder/coder/commit/078f91c4e473c92a5271d8101b212aa1da213e13
feat: record the connection method for session app usagehttps://github.com/coder/coder/commit/df31332657a670e8b4105d31a23fa021a2be2b6a
df31332https://github.com/coder/coder/commit/df31332657a670e8b4105d31a23fa021a2be2b6a
feat: record the connection method for session app usagehttps://github.com/coder/coder/commit/17f7b166914e3f0e322ab6ef3be6f54a992a6022
17f7b16https://github.com/coder/coder/commit/17f7b166914e3f0e322ab6ef3be6f54a992a6022
feat: record the connection method for session app usagehttps://github.com/coder/coder/commit/fb63c2bd6e2cf288414b4d759b8b6c9ab74d95b6
fb63c2bhttps://github.com/coder/coder/commit/fb63c2bd6e2cf288414b4d759b8b6c9ab74d95b6
feat: record the connection method for session app usagehttps://github.com/coder/coder/commit/e6376967e91bd9f405d1c05ccd54f11ae2399280
e637696https://github.com/coder/coder/commit/e6376967e91bd9f405d1c05ccd54f11ae2399280
feat: record the connection method for session app usagehttps://github.com/coder/coder/commit/4898bce18da0674d06ca892be2225f2a96952390
4898bcehttps://github.com/coder/coder/commit/4898bce18da0674d06ca892be2225f2a96952390
https://github.com/EhabY
EhabYhttps://github.com/EhabY
on Oct 26, 2026https://github.com/coder/coder/issues/31012#issuecomment-6426594669
#31028https://github.com/coder/coder/pull/31028
@EhabYhttps://github.com/EhabY
EhabYhttps://github.com/EhabY
not plannedhttps://github.com/coder/coder/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Anot-planned
on Oct 26, 2026https://github.com/coder/coder/issues/31012#event-34302063290
EhabYhttps://github.com/EhabY
on Oct 26, 2026https://github.com/coder/coder/issues/31012#event-34303059935
feat: record the connection method for session app usagehttps://github.com/coder/coder/commit/adfa26bb02af0fc49552088c3de861c28e266594
https://docs.github.com/articles/closing-issues-via-commit-messages
adfa26bhttps://github.com/coder/coder/commit/adfa26bb02af0fc49552088c3de861c28e266594
refactor: share the session app fold rule and method derivation (#31028)https://github.com/coder/coder/commit/7e9735c4ec75840504c1b1e7081132af506f8aa3
#31028https://github.com/coder/coder/pull/31028
https://docs.github.com/articles/closing-issues-via-commit-messages
7e9735chttps://github.com/coder/coder/commit/7e9735c4ec75840504c1b1e7081132af506f8aa3
Sign up for freehttps://github.com/signup?return_to=https://github.com/coder/coder/issues/31012
Sign in to commenthttps://github.com/login?return_to=https://github.com/coder/coder/issues/31012
EhabYhttps://github.com/EhabY
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.