Skip to content

Commit 53f09d7

Browse files
authored
Report language name in debugger command telemetry (#2698)
This PR fixes #2103. Signed-off-by: Denis Golovin dgolovin@redhat.com Signed-off-by: Denis Golovin dgolovin@redhat.com
1 parent 65cbe5d commit 53f09d7

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

src/openshift/component.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ function createCancelledResult(stepName: string): any {
3434
return cancelledResult;
3535
}
3636

37+
function createStartDebuggerResult(language: string, message = '') {
38+
const result: any = new String(message);
39+
result.properties = {
40+
language
41+
}
42+
return result;
43+
}
44+
3745
export enum ComponentContextState {
3846
DEV = 'dev-nrn',
3947
DEV_STARTING = 'dev-str',
@@ -730,11 +738,11 @@ export class Component extends OpenShiftItem {
730738
const result = await debug.startDebugging(workspace.getWorkspaceFolder(Uri.file(component.contextPath)), config);
731739

732740
if (!result) {
733-
return Promise.reject(new VsCommandError('Debugger session failed to start.'));
741+
return Promise.reject(new VsCommandError('Debugger session failed to start.', undefined, undefined, {language: config.type}));
734742
}
735-
return 'Debugger session has successfully started.';
743+
return createStartDebuggerResult(config.type, 'Debugger session has successfully started.');
736744
}
737-
return 'Component has no ports forwarded.'
745+
return createStartDebuggerResult(config.type, 'Component has no ports forwarded.');
738746
}
739747

740748
// TODO: remove "openshift.component.revealContextInExplorer" command

src/telemetry.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ export interface NewComponentCommandProps {
4747
'use_existing_devfile': boolean;
4848
}
4949

50-
export type TelemetryProps = Partial<CommonCommandProps & NewComponentCommandProps>;
50+
export interface DebuggerCommandProps {
51+
language: string;
52+
}
53+
54+
export type TelemetryProps = Partial<CommonCommandProps & NewComponentCommandProps & DebuggerCommandProps>;
5155

5256
export class ExtCommandTelemetryEvent {
5357
private startTime: number;

0 commit comments

Comments
 (0)