Skip to content

Expose per-app session counts in deployment stats, Prometheus, and the UI #27411

Description

@EhabY

Phase 2 of the Scalable Approach for Adding New IDE Session Types RFC. Phase 1 (#27410) stores per-app session counts internally but keeps all external surfaces unchanged; this phase exposes the dynamic counts so admins can see Cursor vs VS Code vs anything else.

Externally visible surfaces dual-publish for one release, then the legacy shape is removed (RFC: "API and metrics compatibility windows"):

  • codersdk.SessionCountDeploymentStats: add a session_counts map field with the full normalized names; keep the existing vscode/jetbrains/ssh/reconnecting_pty fields populated (aggregated by family) for one more release
  • Prometheus: one session count gauge labeled by both app_name and family alongside the four coderd_agentstats_session_count_* gauges, preserving per-app visibility and supporting family aggregation; the old gauges keep publishing for one release, marked deprecated in the Prometheus docs, then removed
  • Telemetry snapshot: add a map field next to the legacy SessionCount* fields; removal of the legacy fields must be coordinated with the telemetry ingestion owners
  • Deployment banner (DeploymentBannerView.tsx): render the map dynamically instead of the four hardcoded entries
  • Extend the existing app registry in codersdk/appname.go (appNameFamilies, NormalizeAppName, and AppNameFamily) with display-name metadata (e.g. vscode → "VS Code") so the UI does not hardcode labels; unrecognized names fall back to the normalized raw identifier. This registry supersedes the earlier coderd/idemetadata design; do not introduce a separate registry.

Done when

  • session_counts map in the deployment stats API, legacy fields still populated by family
  • Labeled gauge exported; legacy gauges deprecated in docs with a removal release noted
  • Telemetry map field lands with ingestion sign-off
  • Deployment banner shows a new app name (e.g. cursor) without further frontend changes
  • Follow-up issue filed to drop the legacy fields/gauges next release

Depends on #27410. The count queries already return per-app session_counts JSONB and fold into families in Go (#29109), so this is API/metrics/UI projection work with no SQL changes.


🤖 Created by Coder Agents on behalf of @EhabY.

Description updated by Coder Agents on behalf of @EhabY: corrected the registry location and recorded the agreed Prometheus label dimensions.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions