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. |
EhabY
added this pull request to stack #29135
September 15, 2026 14:57
EhabY
force-pushed
the
feat/expose-app-session-counts
branch
from
September 16, 2026 11:27
a5de245 to
9abc1e5
Compare
Report session counts per app name alongside the family totals, with display metadata for the recognized apps, and show the breakdown in the deployment banner. Share one normalizing registry lookup for family and metadata, stop cloning cached maps per request, and give the Web Terminal its own icon and label so it is distinguishable from SSH. Commit the per-app Prometheus gauge under the same guard as the other agentstats gauges, so an empty poll window no longer clears it.
EhabY
force-pushed
the
feat/expose-app-session-counts
branch
from
September 16, 2026 12:19
9abc1e5 to
72f01ce
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 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.
Expose per-app session counts in deployment stats, Prometheus, telemetry payloads, and the deployment banner. A single server-owned app registry supplies family attribution, display names, and bundled icons; unrecognized names remain visible without guessed icon URLs.
The banner shows the four busiest apps with stable alphabetical tie-breaks, a keyboard-accessible
+N morepopover, and an icon-based family summary on hover/focus using existing help-popover styling. Overlay content hides when its trigger scrolls out of view using the shared primitive. Apps without a bundled icon (for example the Web Terminal) render a generic icon next to their name so they stay distinguishable. Existing API family fields and the four family Prometheus gauges remain available.The new
coderd_agentstats_session_countgauge carries bothapp_nameandfamily, sums rows that share the configured identity labels, and follows the othercoderd_agentstats_*gauges: a collection with reports replaces the series, a collection with no reports keeps the previous ones.Depends on #28338 (on top of #29109). Targets
feat/arbitrary-session-count-producers, notmain.Refs https://linear.app/codercom/issue/DEVEX-641
Before merge: confirm the compatibility/removal release tracked in https://linear.app/codercom/issue/DEVEX-980 and obtain telemetry receiver/schema/privacy approval. Sender tests do not establish production ingestion compatibility. Arbitrary app names increase metric cardinality; the per-report cap of 64 names (
workspacestats.maxSessionCountEntries) is not a deployment-wide or historical bound.Line-count breakdown
Diff against the stack base
feat/arbitrary-session-count-producersat heada5de245ebc. Counts include comments and blank lines.Testing includes Go tests, a Vitest behavior test, Storybook stories, and shared fixtures. Generated output includes OpenAPI, TypeScript API types, API references, and scanned metrics.
Review follow-up (a5de245)
len(stats) > 0guard. The collector polls an incremental window, so every empty window wiped all per-app series while the legacy gauges kept theirs. It is now committed under the same guard; docs describe the real semantics andTestAgentStatsruns at the original 1ms interval again./icon/terminal.svgwith SSH; it renders the generic icon plus its label.apps?.[id]tolerates a payload without metadata.AppNameFamilyandSessionCountAppMetadata.DeploymentStats()returns the snapshot without cloning maps per request. UnusedSessionCountsByFamilyJSONremoved.agentstats_test.go) and a Vitest behavior test (ordering, overflow, icon fallback, unknown apps). Stories reduced to visual states, with static variants stacked into one story.Verification results
go vet,golangci-lint, gofumpt on changed packages.-raceruns ofcoderd/prometheusmetrics(TestAgentStats,TestAgentSessionCountSnapshots),coderd/metricscache,coderd/telemetry;coderdTestDeploymentStats; fullcodersdk,coderd/workspacestats.tsc, biome, Vitest (DeploymentBannerView.test.tsx), Storybook Chromium run of all 10 banner stories,pnpm run lint-docs.Implementation plan and decisions
DEVEX-641: expose dynamic session counts
Status: implemented and reviewed. User selected app_name + family metric labels and server-owned display names plus local branded icon paths. Exact release numbers and telemetry ingestion sign-off remain unresolved.
Verified baseline
feat/session-family-usage-rollup) -> feat: report arbitrary workspace agent session types #28338 (feat/arbitrary-session-count-producers).session_countsJSON. No SQL, migration, ingestion, proto, insights, or connection-log changes.codersdk/appname.go.Decisions
codersdk/appname.goowns attribution and presentation.SessionCounts map[string]int64plus a siblingappsmap of{display_name, icon}keyed by observed known app name oncodersdk.SessionCountDeploymentStats.iconis an optional server-curated local asset path, never derived from reported names. Unknown names keep their normalized identifier and a generic icon. No metadata endpoint.app_nameandfamily. Arbitrary names remain user-controlled; the 64-name per-report cap is not a deployment-wide bound. Do not silently substitute family-only counts.+N morepopover, known-family totals on hover/focus of Active Connections. Registry-owned icon paths rendered throughExternalImagewith a generic fallback. No synthetic zero-valued entries and no hardcoded frontend app-label list.workspace_agent_stats[].session_countsalongside existing fields. Approval must cover receiver schema and arbitrary normalized app identifiers leaving the deployment.Completion and follow-up
Generated by Coder Agents on behalf of @EhabY.