Skip to content

Commit edaada8

Browse files
Andrew Farriesroboquat
Andrew Farries
authored andcommitted
Increase metric only if image build is required
1 parent f47eaa9 commit edaada8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: components/server/src/workspace/workspace-starter.ts

+5
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ import { ExtendedUser } from "@gitpod/ws-manager/lib/constraints";
114114
import {
115115
FailedInstanceStartReason,
116116
increaseFailedInstanceStartCounter,
117+
increaseImageBuildsStartedTotal,
117118
increaseSuccessfulInstanceStartCounter,
118119
} from "../prometheus-metrics";
119120
import { ContextParser } from "./context-parser-service";
@@ -1255,6 +1256,10 @@ export class WorkspaceStarter {
12551256

12561257
const result = await client.build({ span }, req, imageBuildLogInfo);
12571258

1259+
if (result.actuallyNeedsBuild) {
1260+
increaseImageBuildsStartedTotal();
1261+
}
1262+
12581263
// Update the workspace now that we know what the name of the workspace image will be (which doubles as buildID)
12591264
workspace.imageNameResolved = result.ref;
12601265
span.log({ ref: workspace.imageNameResolved });

0 commit comments

Comments
 (0)