Skip to content

Conversation

ssncferreira
Copy link
Contributor

@ssncferreira ssncferreira commented Aug 29, 2025

Description

When creating a prebuilt workspace, both flags.IsPrebuild and flags.IsFirstBuild are true. Previously, the logic rejected cases with multiple flags, so coderd_workspace_creation_duration_seconds wasn’t updated for prebuilt creations. This is the only valid scenario where two flags can be true.

Changes

  • Fix logic to update coderd_workspace_creation_duration_seconds metric for prebuilt workspaces.
  • Add prebuild helper functions to coderdenttest (other prebuild tests can reuse this).
  • Update workspace's provisionerdmetric tests to include this metric.

Follow-up: #19503
Related to: #19528

@ssncferreira ssncferreira changed the title fix: prebuilt workspace creation duration metric fix: fix logic for reporting prebuilt workspace duration metric Aug 29, 2025
@ssncferreira ssncferreira force-pushed the ssncferreira/fix-prebuild-creation-metric branch from 3cde6ae to 1631ffd Compare August 29, 2025 13:02
@ssncferreira ssncferreira changed the title fix: fix logic for reporting prebuilt workspace duration metric fix(coderd): fix logic for reporting prebuilt workspace duration metric Aug 29, 2025
@ssncferreira ssncferreira marked this pull request as ready for review August 29, 2025 13:05
@ssncferreira ssncferreira added the cherry-pick/v2.26 Needs to be cherry-picked to the 2.26 release branch label Aug 29, 2025
Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

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

LGTM, with a couple nits.

@ssncferreira ssncferreira merged commit 353f5de into main Aug 29, 2025
31 checks passed
@ssncferreira ssncferreira deleted the ssncferreira/fix-prebuild-creation-metric branch August 29, 2025 14:48
@github-actions github-actions bot locked and limited conversation to collaborators Aug 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cherry-pick/v2.26 Needs to be cherry-picked to the 2.26 release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants