-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[server] Add counter metric for image build starts #14204
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
Conversation
started the job as gitpod-build-af-fix-server-image-build-total-metric.6 because the annotations in the pull request description changed |
/hold we should deploy the revert (#14203) first to clear the faulty metric from |
@@ -1257,6 +1256,10 @@ export class WorkspaceStarter { | |||
|
|||
const result = await client.build({ span }, req, imageBuildLogInfo); | |||
|
|||
if (result.actuallyNeedsBuild) { | |||
increaseImageBuildsStartedTotal(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At what point does this increment? Is it after we've completed the build? Or is the build
method async and it tells us it needs to be build and returns?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the build
call on line 1257 awaits until the build starts:
gitpod/components/image-builder-api/typescript/src/sugar.ts
Lines 176 to 177 in c551c2c
// build returns a nested promise. The outer one resolves/rejects with the build start, | |
// the inner one resolves/rejects when the build is done. |
so we're incrementing on build start here, not completion.
The build completion is awaited further down this file on line 1281:
buildResult = await result.buildPromise; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
0dd057c
to
c551c2c
Compare
@@ -1257,6 +1256,10 @@ export class WorkspaceStarter { | |||
|
|||
const result = await client.build({ span }, req, imageBuildLogInfo); | |||
|
|||
if (result.actuallyNeedsBuild) { | |||
increaseImageBuildsStartedTotal(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
started the job as gitpod-build-af-fix-server-image-build-total-metric.9 because the annotations in the pull request description changed |
Description
Re-do of #14185 (reverted in #14203), this time incrementing the metric only on image builds.
Related Issue(s)
Part of #12960
How to test
kubectl port-forward deploy/server 9500:9500
server
metrics endpoint at:9500/metrics
and look for thegitpod_server_image_builds_started_total
metric.Release Notes
Documentation
Werft options:
If enabled this will build
install/preview
Valid options are
all
,workspace
,webapp
,ide