Skip to content

Expose coderd_workspaces as a Prometheus metric #12462

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bpmct opened this issue Mar 7, 2024 · 3 comments
Closed

Expose coderd_workspaces as a Prometheus metric #12462

bpmct opened this issue Mar 7, 2024 · 3 comments
Assignees
Labels
customer-requested Features requested by enterprise customers. Only humans may set this. scaletest Issues related to scale testing.

Comments

@bpmct
Copy link
Member

bpmct commented Mar 7, 2024

We currently have workspace_builds, but being able to query the current number of workspaces (including their template and state) can be valuable for understanding usage. We should expose similar fields as the builds metric

# HELP coderd_workspace_builds_total The number of workspaces started, updated, or deleted.
# TYPE coderd_workspace_builds_total counter
coderd_workspace_builds_total{status="failed",template_name="docker",template_version="dazzling_chaum0",workspace_name="workspace-1",workspace_owner="admin",workspace_transition="START"} 1
coderd_workspace_builds_total{status="success",template_name="docker",template_version="dazzling_chaum0",workspace_name="workspace-1",workspace_owner="admin",workspace_transition="START"} 1
coderd_workspace_builds_total{status="success",template_name="docker",template_version="dazzling_chaum0",workspace_name="workspace-1",workspace_owner="admin",workspace_transition="STOP"} 1
@bpmct bpmct added the customer-reported Bugs reported by enterprise customers. Only humans may set this. label Mar 7, 2024
@coder-labeler coder-labeler bot added feature scaletest Issues related to scale testing. labels Mar 7, 2024
@stirby stirby added this to the Stable Releases milestone Mar 7, 2024
@matifali matifali added customer-requested Features requested by enterprise customers. Only humans may set this. and removed customer-reported Bugs reported by enterprise customers. Only humans may set this. labels Mar 8, 2024
@matifali matifali removed this from the Stable Releases milestone Mar 8, 2024
@spikecurtis
Copy link
Contributor

We can do this, but it has sharp edges around multiple Coderd replicas.

Essentially, the metric is a statistic that is scoped to the entire deployment (that is, workspaces aren't tied to a particular coderd server), but each Coderd would report the metric. It would be very easy to write a dashboard that sums the metric, in which case you'll over-report by the multiple of Coderds you have.

@spikecurtis
Copy link
Contributor

One other thing is that I re-read the original customer ask, and I think what they want is a GUAGE that tracks the current number of workspaces in a particular state, not a counter of builds.

@dannykopping
Copy link
Contributor

Closed by #12762

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-requested Features requested by enterprise customers. Only humans may set this. scaletest Issues related to scale testing.
Projects
None yet
Development

No branches or pull requests

5 participants