File tree 2 files changed +25
-0
lines changed 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -123,4 +123,26 @@ const gitpodVersionInfo = new prometheusClient.Gauge({
123
123
124
124
export function setGitpodVersion ( gitpod_version : string ) {
125
125
gitpodVersionInfo . set ( { gitpod_version} , 1 )
126
+ }
127
+
128
+ const instanceStartsSuccessTotal = new prometheusClient . Counter ( {
129
+ name : 'gitpod_server_instance_starts_success_total' ,
130
+ help : 'Total amount of successfully performed instance starts' ,
131
+ labelNames : [ 'retries' ] ,
132
+ registers : [ prometheusClient . register ] ,
133
+ } ) ;
134
+
135
+ export function increaseSuccessfulInstanceStartCounter ( retries : number = 0 ) {
136
+ instanceStartsSuccessTotal . inc ( { retries } ) ;
137
+ }
138
+
139
+ const instanceStartsFailedTotal = new prometheusClient . Counter ( {
140
+ name : 'gitpod_server_instance_starts_failed_total' ,
141
+ help : 'Total amount of failed performed instance starts' ,
142
+ labelNames : [ 'reason' ] ,
143
+ registers : [ prometheusClient . register ] ,
144
+ } ) ;
145
+
146
+ export function increaseFailedInstanceStartCounter ( reason : "clusterSelectionFailed" ) {
147
+ instanceStartsFailedTotal . inc ( { reason } ) ;
126
148
}
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ import { WithReferrerContext } from "@gitpod/gitpod-protocol/lib/protocol";
36
36
import { IDEOption } from "@gitpod/gitpod-protocol/lib/ide-protocol" ;
37
37
import { Deferred } from "@gitpod/gitpod-protocol/lib/util/deferred" ;
38
38
import { ExtendedUser } from "@gitpod/ws-manager/lib/constraints" ;
39
+ import { increaseFailedInstanceStartCounter , increaseSuccessfulInstanceStartCounter } from "../prometheus-metrics" ;
39
40
40
41
export interface StartWorkspaceOptions {
41
42
rethrow ?: boolean ;
@@ -197,8 +198,10 @@ export class WorkspaceStarter {
197
198
}
198
199
199
200
if ( ! resp ) {
201
+ increaseFailedInstanceStartCounter ( "clusterSelectionFailed" ) ;
200
202
throw new Error ( "cannot start a workspace because no workspace clusters are available" ) ;
201
203
}
204
+ increaseSuccessfulInstanceStartCounter ( retries ) ;
202
205
203
206
span . log ( { "resp" : resp } ) ;
204
207
You can’t perform that action at this time.
0 commit comments