File tree 2 files changed +15
-0
lines changed
components/ws-manager-bridge
2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,12 @@ export class WorkspaceManagerBridgeEE extends WorkspaceManagerBridge {
56
56
return
57
57
}
58
58
span . setTag ( "updatePrebuiltWorkspace.prebuildId" , prebuild . id ) ;
59
+ span . setTag ( "updatePrebuiltWorkspace.workspaceInstance.statusVersion" , status . statusVersion ) ;
60
+
61
+ if ( prebuild . statusVersion <= status . statusVersion ) {
62
+ this . prometheusExporter . recordStalePrebuildEvent ( )
63
+ }
64
+ prebuild . statusVersion = status . statusVersion
59
65
60
66
if ( prebuild . state === 'queued' ) {
61
67
// We've received an update from ws-man for this workspace, hence it must be running.
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ export class PrometheusMetricsExporter {
16
16
protected readonly clusterScore : prom . Gauge < string > ;
17
17
protected readonly clusterCordoned : prom . Gauge < string > ;
18
18
protected readonly statusUpdatesTotal : prom . Counter < string > ;
19
+ protected readonly stalePrebuildEventsTotal : prom . Counter < string > ;
19
20
20
21
protected activeClusterNames = new Set < string > ( ) ;
21
22
@@ -47,6 +48,10 @@ export class PrometheusMetricsExporter {
47
48
help : 'Total workspace status updates received' ,
48
49
labelNames : [ "workspace_cluster" , "known_instance" ]
49
50
} ) ;
51
+ this . stalePrebuildEventsTotal = new prom . Counter ( {
52
+ name : "gitpod_ws_manager_bridge_stale_prebuild_events_total" ,
53
+ help : "Total count of stale prebuild events received by workspace manager bridge"
54
+ } )
50
55
}
51
56
52
57
observeWorkspaceStartupTime ( instance : WorkspaceInstance ) : void {
@@ -87,5 +92,9 @@ export class PrometheusMetricsExporter {
87
92
statusUpdateReceived ( installation : string , knownInstance : boolean ) : void {
88
93
this . statusUpdatesTotal . labels ( installation , knownInstance ? "true" : "false" ) . inc ( ) ;
89
94
}
95
+
96
+ recordStalePrebuildEvent ( ) : void {
97
+ this . stalePrebuildEventsTotal . inc ( ) ;
98
+ }
90
99
}
91
100
You can’t perform that action at this time.
0 commit comments