Skip to content

Export per-app usage time per template to Prometheus #29940

Description

@EhabY

coderd_insights_applications_usage_seconds reports built-in apps as family totals (VS Code Family, JetBrains, SSH, Web Terminal), so Prometheus has no per-app usage time per template, such as Cursor versus VS Code. coderd_agentstats_session_count{app_name} is per app, but it is opt-in (CODER_PROMETHEUS_COLLECT_AGENT_STATS) and counts open sessions, not time.

The insights collector already has per-app seconds (SessionAppUsageSeconds) and sums them with codersdk.SumByFamily before export.

Proposal: a separate metric, such as coderd_insights_session_apps_usage_seconds{template_name, organization_name, family, app_name}. Clients choose app names, so it should label only registered apps and total the rest under unknown.

Refs #27412

Activity

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

Metadata

Metadata

Assignees

Labels

featureobservabilityIssues related to observability (metrics, dashboards, alerts, opentelemetry)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions