- Notifications
You must be signed in to change notification settings - Fork1k
feat: add prebuild timing metrics to Prometheus#19503
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
1cd4417
73af00e
ea19217
11d7ed3
3cde491
b59ebad
20f6493
2c325cc
fc13c44
0426f3a
b888c8f
2d4a1f4
b18fbe4
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -923,3 +923,36 @@ SET | ||
user_acl = @user_acl | ||
WHERE | ||
id = @id; | ||
-- name: GetRegularWorkspaceCreateMetrics :many | ||
-- Count regular workspaces: only those whose first successful 'start' build | ||
-- was not initiated by the prebuild system user. | ||
WITH first_success_build AS ( | ||
-- Earliest successful 'start' build per workspace | ||
SELECT DISTINCT ON (wb.workspace_id) | ||
wb.workspace_id, | ||
wb.template_version_preset_id, | ||
wb.initiator_id | ||
FROM workspace_builds wb | ||
JOIN provisioner_jobs pj ON pj.id = wb.job_id | ||
WHERE | ||
wb.transition = 'start'::workspace_transition | ||
AND pj.job_status = 'succeeded'::provisioner_job_status | ||
ORDER BY wb.workspace_id, wb.build_number, wb.id | ||
) | ||
SELECT | ||
t.name AS template_name, | ||
COALESCE(tvp.name, '') AS preset_name, | ||
o.name AS organization_name, | ||
COUNT(*) AS created_count | ||
FROM first_success_build fsb | ||
JOIN workspaces w ON w.id = fsb.workspace_id | ||
JOIN templates t ON t.id = w.template_id | ||
LEFT JOIN template_version_presets tvp ON tvp.id = fsb.template_version_preset_id | ||
JOIN organizations o ON o.id = w.organization_id | ||
WHERE | ||
NOT t.deleted | ||
-- Exclude workspaces whose first successful start was the prebuilds system user | ||
AND fsb.initiator_id != 'c42fdf75-3097-471c-8c33-fb52454d81c0'::uuid | ||
GROUP BY t.name, COALESCE(tvp.name, ''), o.name | ||
ORDER BY t.name, preset_name, o.name; | ||
ContributorAuthor
|
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.