Skip to content

Commit 959a4a5

Browse files
author
Andrew Farries
committed
Add prometheus metric for image builds started
1 parent b8e9226 commit 959a4a5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: components/server/src/prometheus-metrics.ts

+10
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export function registerServerMetrics(registry: prometheusClient.Registry) {
2121
registry.registerMetric(instanceStartsFailedTotal);
2222
registry.registerMetric(prebuildsStartedTotal);
2323
registry.registerMetric(stripeClientRequestsCompletedDurationSeconds);
24+
registry.registerMetric(imageBuildsStartedTotal);
2425
}
2526

2627
const loginCounter = new prometheusClient.Counter({
@@ -176,3 +177,12 @@ export const stripeClientRequestsCompletedDurationSeconds = new prometheusClient
176177
export function observeStripeClientRequestsCompleted(operation: string, outcome: string, durationInSeconds: number) {
177178
stripeClientRequestsCompletedDurationSeconds.observe({ operation, outcome }, durationInSeconds);
178179
}
180+
181+
export const imageBuildsStartedTotal = new prometheusClient.Counter({
182+
name: "gitpod_server_image_builds_started_total",
183+
help: "counter of the total number of image builds started on server",
184+
});
185+
186+
export function increaseImageBuildsStartedTotal() {
187+
imageBuildsStartedTotal.inc();
188+
}

0 commit comments

Comments
 (0)