@@ -16,6 +16,7 @@ import { timeout } from './common/async';
1616import { MetricsReporter , getConnectMetricsInterceptor } from './metrics' ;
1717import { ILogService } from './services/logService' ;
1818import { WrapError } from './common/utils' ;
19+ import { ITelemetryService } from './common/telemetry' ;
1920
2021function isTelemetryEnabled ( ) : boolean {
2122 const TELEMETRY_CONFIG_ID = 'telemetry' ;
@@ -52,7 +53,12 @@ export class GitpodPublicApi extends Disposable implements IGitpodAPI {
5253
5354 private workspaceStatusStreamMap = new Map < string , { onStatusChanged : vscode . Event < WorkspaceStatus > ; dispose : ( force ?: boolean ) => void ; increment : ( ) => void } > ( ) ;
5455
55- constructor ( private accessToken : string , private gitpodHost : string , private logger : ILogService ) {
56+ constructor (
57+ private readonly accessToken : string ,
58+ private readonly gitpodHost : string ,
59+ private readonly logger : ILogService ,
60+ private readonly telemetryService : ITelemetryService
61+ ) {
5662 super ( ) ;
5763
5864 this . createClients ( ) ;
@@ -201,6 +207,7 @@ export class GitpodPublicApi extends Disposable implements IGitpodAPI {
201207 // Remove this once it's fixed upstream
202208 const message : string = e . stack || e . message || `${ e } ` ;
203209 if ( message . includes ( 'New streams cannot be created after receiving a GOAWAY' ) ) {
210+ this . telemetryService . sendTelemetryException ( e ) ;
204211 this . logger . error ( 'Got GOAWAY bug, recreating connect client' ) ;
205212 this . createClients ( ) ;
206213 }
@@ -236,6 +243,7 @@ export class GitpodPublicApi extends Disposable implements IGitpodAPI {
236243 // Remove this once it's fixed upstream
237244 const message : string = e . stack || e . message || `${ e } ` ;
238245 if ( message . includes ( 'New streams cannot be created after receiving a GOAWAY' ) ) {
246+ this . telemetryService . sendTelemetryException ( e ) ;
239247 this . logger . error ( 'Got GOAWAY bug, recreating connect client' ) ;
240248 this . createClients ( ) ;
241249
0 commit comments