GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: separate connection log methods from app identities by EhabY · Pull Request #29674 · coder/coder

Conversation

@EhabY

@EhabY EhabY commented Sep 21, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Separates how a connection was established from the originating app identity, following the Completing Scalable IDE Session Tracking RFC. This is the storage, HTTP API, filters and frontend half of phase 3; #29675 adds explicit agent reporting on top.

connection_logs.connection_method is a validated enum; app_name_or_port remains nullable text. Historical VS Code and JetBrains rows become SSH with their identity retained. Missing client identity stays NULL and HTTP app_name is omitted. Workspace-app slugs and forwarded ports remain destinations in web_info.slug_or_port, never client identities. The deprecated HTTP type stays available as a plain string, with SSH family compatibility mappings; TypeScript/OpenAPI and the UI use the new method field.

Legacy type: and lifecycle status: filters remain supported. New method: and normalized client-only app: filters intersect consistently in list and count queries. PTY is labeled Reconnecting PTY, because browser terminals and the CLI share that method.

Upgrade impact: the migration rewrites the table under an ACCESS EXCLUSIVE lock. On synthetic indexed PostgreSQL 13.21 data, with 2 CPUs and 6 GB on a shared host, observed upgrade lock durations were 5.83 s / 49.7 s / 99.5 s for 1M / 10M / 25M rows. Rollback durations were 4.15 s / 51.3 s / 400.1 s; the last was an unrepeated disk-bound outlier, not a typical estimate. Upgrade WAL was approximately 354 MB / 3.5 GB / 8.8 GB. These replace the earlier source/text benchmarks and do not measure waiting to acquire the lock under production traffic. All seeded rows were checked after upgrade and rollback. Downgrading collapses client identities to historical families; empty destination strings and legacy non-destination values normalize to NULL.

Go SDK consumers must adapt ConnectionLog.Type from ConnectionType to string. Service-log fields Type and SlugOrPort become ConnectionMethod and AppNameOrPort; the unrelated lowercase direct/DERP routing field connection_method is unchanged.

Agreed implementation contract and verification evidence
  1. Rebase on main and preserve landed connection correlation/shared reporter foundations; keep this PR separate from agent reporting.
  2. Use method enum values ssh, reconnecting_pty, workspace_app, port_forwarding and tunnel; retain extensible normalized app identifiers without a registry allowlist.
  3. Migrate historical identities exactly, preserve nullable storage, and keep client identity separate from destination fields. Optional registry display metadata is omitted when identity is absent.
  4. Preserve old-agent fallback: SSH and TYPE_UNSPECIFIED map to SSH without identity, VSCODE/JETBRAINS recover identity, PTY keeps identity absent, unknown numeric legacy types are rejected. Explicit new protobuf fields follow in feat: report the app that made a connection #29675.
  5. Keep legacy filters; introduce identity-only app and explicit method filters. Update HTTP compatibility fields, generated types, frontend and documentation together.
  6. Validate actual enum migration, including a seeded 557–614 single-transaction regression. The earlier enum addition requires text comparisons to avoid PostgreSQL unsafe-use errors.

Verification: make gen, make lint and make pre-commit passed; the full Go suite completed 34,783 tests with 50 skips; the site production build passed; all 285 frontend unit files passed (4,477 tests, 2 skips) on a rerun with two workers. The initial concurrent pre-push frontend run had unrelated timeouts; the remaining focused suites passed on unchanged main and this branch when rerun after contention subsided. Connection-log stories passed, including deliberately conflicting deprecated type values. Migration mapping, rollback, PostgreSQL 13/17 single-transaction checks and large-table measurements completed. Raw benchmark artifacts were provided in the implementation chat.

Phase 6 duration grouping and agent raw port-forward reporting are deliberately excluded. JetBrains per-product propagation is a separate researched follow-up, not claimed complete here.

Refs #27412. Generated with Coder Agents on behalf of @EhabY.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@github-actions

github-actions Bot commented Sep 21, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Docs preview

Check 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.

  • docs/admin/monitoring/connection-logs.md
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@linear-code

linear-code Bot commented Sep 21, 2026

Copy link
Copy Markdown

CLIENT-640

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@EhabY EhabY mentioned this pull request Sep 21, 2026
feat: report the app that made a connection #29675
Closed
@github-actions github-actions Bot assigned EhabY Sep 21, 2026
@EhabY
EhabY added this pull request to stack #29676 September 21, 2026 17:21
@EhabY EhabY changed the title feat(coderd): store the connection log type as text feat: store the connection log type as text Sep 21, 2026
@EhabY
EhabY force-pushed the ehab/client-640-connection-log-type-text branch from 462179d to 596abb3 Compare September 21, 2026 17:41
@EhabY
EhabY force-pushed the ehab/client-640-connection-log-type-text branch from 596abb3 to b14818c Compare September 22, 2026 14:16
@EhabY
EhabY force-pushed the ehab/client-640-connection-log-type-text branch 2 times, most recently from 21fb010 to dd08483 Compare September 23, 2026 11:12
@EhabY
EhabY force-pushed the ehab/client-640-connection-log-type-text branch from dd08483 to 4a05a54 Compare September 23, 2026 11:26
@EhabY
EhabY marked this pull request as ready for review September 23, 2026 12:34
@EhabY
EhabY force-pushed the ehab/client-640-connection-log-type-text branch 3 times, most recently from e38f9e4 to 2d8f222 Compare September 23, 2026 13:47
@coderagents

coderagents Bot commented Sep 23, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Documentation Check

Updates Needed

  • docs/admin/monitoring/connection-logs.md (open) (addressed by redesign in 48a9cce)
    The unknown filter value this item flagged no longer exists, and the page now documents the new surface in full: the method and app filters, the deprecated type filter with an explicit deprecation table, the reworked response fields (connection_method, app_name, app_display_name), and the changed service-log fields (ConnectionMethod, AppNameOrPort, ClientSessionID). Verified against codersdk/connectionlog.go, coderd/database/sdk2db/sdk2db.go, coderd/database/queries/connectionlogs.sql, and coderd/database/modelmethods.go.

Automated review via Coder Agents

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@EhabY
EhabY force-pushed the ehab/client-640-connection-log-type-text branch from 2d8f222 to e48b0ac Compare September 23, 2026 14:30
@EhabY
EhabY requested a review from code-asher September 23, 2026 14:32
@EhabY EhabY mentioned this pull request Sep 23, 2026
feat!: report template insights session usage per app #29796
Merged
code-asher
code-asher reviewed Sep 23, 2026
View reviewed changes

@code-asher code-asher left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we have some conflicts between a connection "type" and the app name over that connection type that we should try to iron out.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

EhabY reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread coderd/database/migrations/000600_connection_logs_type_text.up.sql Outdated
-- The enum held only families, so VS Code forks logged as vscode. Rewrites
-- the table under an exclusive lock.
ALTER TABLE connection_logs
ALTER COLUMN type TYPE text;

@code-asher code-asher Sep 23, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could make sense to also rename the column to app_name? Type to me implies a grouping like we had before, but now these are individual app names.

Although for web apps it is still a grouping. 🤔 I suppose we could put the slug here instead? But I see we already have slug_or_port.

And we still have types like tunnel. hrmm. Maybe we need both type and app_name? For apps like VS Code we could set the type to ssh? Then we could use slug_or_port to store the app name vscode? (possibly renaming it to app_name_or_port)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@EhabY EhabY Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually true, this was a bit inconsistent and confusing. type was mixing apps with connection types. Went with your app_name_or_port idea, plus a rename of type:

  • type is now kind, a closed enum of what observed the connection: the agent for ssh and reconnecting_pty, coderd for workspace_app, port_forwarding, and tunnel. VS Code, Cursor, and Zed are all ssh, as you suggested.
  • slug_or_port is now app_name_or_port, read by kind: the app an agent reported, a workspace app slug, or a port.

Both are renames only, so the table is no longer rewritten and the enum stays. Families are never stored: the API type is the grouping again, derived from the app registry on read, so Cursor returns type: vscode with app_name: cursor, and adding an app or family needs no migration. Older rows keep vscode/jetbrains in kind with no app name, and read as that app. There's also a new app: filter that matches an agent app name or a workspace app slug.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@code-asher code-asher Sep 25, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!!

I think we should replace vscode and jetbrains now in the migration with ssh (and populate their app_name_or_port with vscode or jetbrains as appropriate) to match the data going forward.

And then, if we do that, the "kind" name might need changing. The comment says "what observed the connection" which makes me think "subsystem" although maybe it is more like "transport" (or dare I say "connection type"). Although transport means something specific so maybe subsystem would be better.

Like the data goes through SSH, or a workspace app, or a port forward, or the agent's reconnecting-pty HTTP API, many of which flow through (and are observed, if not reported by) both coderd and the agent.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@code-asher code-asher Sep 25, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And then, where we report the connection, instead of mapping the app name to the transport (like mapping jetbrains/vscode to SSH), we should just rely on what we know the actual subsystem is (so for agentssh.NewServer obviously we know it is always ssh, etc).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@spikecurtis spikecurtis Sep 25, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RFC says to get rid of the enum and we should! The values that exist don't cover all the possibilities now or in future, and lead to us skipping connection logs (if the kind is unknown) or writing something not true (like assuming anything we don't recognize is SSH).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@EhabY EhabY Sep 25, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay I've replaced the connection type with with source which is a string with 4 known values as we agreed above, by grouping ssh and reconnecting_pty it actually made the queries and logic everywhere simpler!

I'll now run a more comprehensive benchmark and see if this table is unbounded and how many rows might there be.

Edit: Added the synthetic benchmarks in the description.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@code-asher code-asher Sep 25, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think the problem is that we had the connection "type" tangled up with the name of the app making that connection. App names are dynamic; new ones can appear at any time, requiring coderd source change to start tracking them, which was the problem.

Connection types are static, the only way new types appear is if someone modifies the source. Since the source is being modified, the enum can be modified at the same time. And since the types are well-known and static, an enum seems a natural fit to me.

I think at the time of the RFC we were thinking the type column was essentially just a static "app name", or at least that is how I was thinking about it, and so that we could therefore drop it (and its enum) entirely.

We could still drop type and its enum entirely, if we are not particularly concerned with how the connection was made or what subsystem it went through, just that it exists and what app it was for, and fall back to the "type" for the app name when the app name is unknown (so an SSH connection would show "ssh" for the app name instead of "ssh" for the type and a blank app name).

But that would also collapse some things into each other, like web VS Code versus desktop VS Code would look the same instead of one type being "workspace_app" and another "ssh", both with the "vscode" app name.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@code-asher code-asher Sep 25, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also perhaps interesting to note that even the reconnecting pty can be used by different applications; currently it is used by the web terminal but can also be used on the command line via the cli.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@EhabY EhabY Sep 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do think that we should still do string over an enum because we do not know if this list is truly exhaustive. We can do the check in Go but the DB type can be string. Now for agent vs. ssh and reconnecting_pty, if we want to differentiate between say normal CLI (ssh) and reconnecting_pty CLI then we should have the following sources (we can call it protocol now I suppose): ssh, reconnecting_pty, workspace_app, port_forwarding, tunnel, unknown with the following semantics:

┌──────────────────┬──────────────────┬────────────────────┐
│     Old type     │   → protocol     │ → app_name_or_port │
├──────────────────┼──────────────────┼────────────────────┤
│ ssh              │ ssh              │ NULL               │
├──────────────────┼──────────────────┼────────────────────┤
│ vscode           │ ssh              │ vscode             │
├──────────────────┼──────────────────┼────────────────────┤
│ jetbrains        │ ssh              │ jetbrains          │
├──────────────────┼──────────────────┼────────────────────┤
│ reconnecting_pty │ reconnecting_pty │ NULL               │
├──────────────────┼──────────────────┼────────────────────┤
│ web types        │ unchanged        │ unchanged          │
└──────────────────┴──────────────────┴────────────────────┘

In this case, we support proper protocol and we can even expose it in the API (for example, if we wanna tell reconnecting_pty from the web terminal vs. the CLI).

Actually, in this case, the agent.proto type: enum would still be deprecated but we can add a protocol: string so let's resolve this here before we modify #29675...

@spikecurtis @code-asher Thoughts?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@spikecurtis spikecurtis Sep 28, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In considering whether to have the DB type be enum or string, I think the right question to think about is how important is constraining the set of values? If you do an enum, it's constrained at the database and we literally cannot represent an errant value.

If we do a string, then we lose strong constraints, but gain a lot of flexibility. It's easier to add new things.

For this case, where we are doing a sort of best-effort log of connections, I don't think we gain that much by making the constraints air-tight, and the flexibility to add new things without a DB schema migration are appealing.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Base automatically changed from feat/expose-app-session-counts to main September 24, 2026 12:12
@EhabY
EhabY force-pushed the ehab/client-640-connection-log-type-text branch from 55ab9fd to 71742a3 Compare September 24, 2026 12:26
@EhabY EhabY changed the title feat: store the connection log type as text feat: split the connection log type into kind and app name Sep 24, 2026
@EhabY
EhabY force-pushed the ehab/client-640-connection-log-type-text branch from 6cd8d30 to 5738c29 Compare September 24, 2026 15:54
@EhabY
EhabY requested a review from code-asher September 24, 2026 16:03
@EhabY
EhabY force-pushed the ehab/client-640-connection-log-type-text branch from e906056 to bed4132 Compare September 24, 2026 16:38
EhabY added a commit that referenced this pull request Sep 24, 2026
@EhabY
fix: expect the Web Terminal icon and share AppDisplayName
9667748
The registry now gives reconnecting_pty an icon, so the deployment stats
test expects it. SessionAppPresentation builds on AppDisplayName, which
#29674 adds with the same definition.
@EhabY
EhabY force-pushed the ehab/client-640-connection-log-type-text branch 2 times, most recently from 99508ee to f964b80 Compare September 25, 2026 13:16
@EhabY EhabY changed the title feat: split the connection log type into kind and app name feat: split the connection log type into source and app name Sep 25, 2026
@EhabY EhabY mentioned this pull request Sep 25, 2026
feat!: label the VS Code family and report built-in app usage per app #29906
Merged
@EhabY
EhabY requested a review from spikecurtis September 25, 2026 17:01
@EhabY
EhabY force-pushed the ehab/client-640-connection-log-type-text branch 2 times, most recently from 863403a to c0ca459 Compare September 28, 2026 08:53
spikecurtis
spikecurtis requested changes Sep 28, 2026
View reviewed changes

@spikecurtis spikecurtis left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole thing is still half baked.

It changes the database to "source" and removes type, but we're still talking about Connection Types on the codersdk and API.

We're flying by the seat of our pants here. We deviated from the RFC, for legit reasons, but we can't be making a change as big and far reaching as this one PR by PR. It needs a new RFC that actually plans this out.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@EhabY EhabY mentioned this pull request Sep 29, 2026
feat: recognize VS Code forks and JetBrains IDEs as session apps #30116
Merged
EhabY and others added 5 commits October 7, 2026 12:16
@EhabY
feat: split the connection log type into kind and app name
48a9cce
connection_logs.type mixed app names with connection types. Rename it to
kind, which records what observed the connection, and rename slug_or_port
to app_name_or_port: the app an agent reported, a workspace app slug, or a
port.

The API type is derived from the app registry on read, so a Cursor session
reads as type vscode with app_name cursor. type:vscode matches every app in
the family, type:unknown matches apps outside the registry, and the new app:
filter matches an agent app name or a workspace app slug. The site's type
labels are generated from the registry, and the family is labeled Visual
Studio Code.
@EhabY
refactor: store the connection log source as text
2ddbae6
Replace the kind enum with source, a text column with four known values:
agent, workspace_app, port_forwarding, and tunnel. Agent rows keep the app
in app_name_or_port, which tells SSH from the web terminal, so a new app or
agent feature needs no migration.

The migration converts old rows too: vscode, jetbrains, ssh, and
reconnecting_pty become source agent with that app name. Both columns
convert in one ALTER, so the table is rewritten once, about 1.7s per million
rows.

db2sdk maps a row's source and app to the API type, and sdk2db maps a type
filter back, so the two directions sit together and a test pins them. The
agent's connection type maps to an app name in sdk2db, and an unspecified
type logs as app unknown instead of being dropped.

The VS Code family is labeled VS Code Family, apart from the VS Code app.
@EhabY
test: tighten the connection log source migration test
bfa1a99
Table the rows each migration direction converts, and use fixed SQL, which
also fixes the gosec G202 lint on the concatenated column list.
@EhabY
feat: separate connection methods from app identities
ba51be6
@EhabY
test(coderd/database): cover connection method upgrade transactions
f6c9581
@EhabY
EhabY force-pushed the ehab/client-640-connection-log-type-text branch from c0ca459 to f6c9581 Compare October 7, 2026 12:46
@EhabY
EhabY requested a review from nickvigilante as a code owner October 7, 2026 12:46
@EhabY EhabY changed the title feat: split the connection log type into source and app name feat: separate connection log methods from app identities Oct 7, 2026
@EhabY
EhabY marked this pull request as draft October 7, 2026 13:00
@EhabY EhabY mentioned this pull request Oct 7, 2026
feat: separate connection log methods from app names #30466
Merged
@EhabY

EhabY commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by draft #30466; agent reporting follows in #30467. This PR retains the earlier review history and migration investigation. Generated with Coder Agents on behalf of @EhabY.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@EhabY EhabY closed this Oct 7, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@spikecurtis spikecurtis spikecurtis requested changes
@code-asher code-asher Awaiting requested review from code-asher
@nickvigilante nickvigilante Awaiting requested review from nickvigilante

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@EhabY EhabY

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@EhabY @spikecurtis @code-asher
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.