Skip to content

extensions observability #422

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 5, 2022
Merged

extensions observability #422

merged 1 commit into from
Sep 5, 2022

Conversation

akosyakov
Copy link
Member

@akosyakov akosyakov commented Sep 1, 2022

Supporting for gitpod-io/gitpod#12539. See this PR for explanation and how to test.

@akosyakov akosyakov self-assigned this Sep 1, 2022
@akosyakov akosyakov changed the base branch from main to gp-code/main September 1, 2022 13:31
@akosyakov akosyakov changed the title extension installation metrics extensions observability Sep 1, 2022
@akosyakov akosyakov force-pushed the ak/ext_metrics branch 2 times, most recently from 63796b8 to 9d2bac4 Compare September 1, 2022 13:46
@akosyakov akosyakov marked this pull request as ready for review September 2, 2022 12:47
Copy link

@andreafalzetti andreafalzetti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on main PR 💯

Code changes LGTM

@akosyakov akosyakov merged commit 06783e7 into gp-code/main Sep 5, 2022
@akosyakov akosyakov deleted the ak/ext_metrics branch September 5, 2022 06:37
@jeanp413
Copy link
Member

jeanp413 commented Sep 5, 2022

As I was on holiday on friday I didn't have time to do a proper review, will add comments so maybe they are addressed in the future


export class GitpodInsightsAppender implements ITelemetryAppender {
private _baseProperties: { appName: string; uiKind: 'web'; version: string };
private readonly _baseProperties: { appName: string; uiKind: 'web'; version: string };
private readonly devMode = this.productService.nameShort.endsWith(' Dev');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look nice, should be moved to workbench.ts and if true then set gitpodPreview to undefined and use that as a check here

window.postMessage({ type: 'vscode_telemetry', event: trackMessage.event, properties: trackMessage.properties }, '*');
}

private async sendMetrics(eventName: string, data: any): Promise<void> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The browser gitpodInsightsAppender.ts is just and edge for the reconnection events when we lose connection to the remote server, all other events will be send to the remote so not sure if we need the sendMetrics logic here


export function mapTelemetryData(kind: SenderKind, eventName: string, data: any): RemoteTrackMessage | undefined {
if (kind === SenderKind.Node) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not keep using the enum?

export class GitpodInsightsAppender implements ITelemetryAppender {

private _asyncAIClient: Promise<GitpodConnection> | null;
private _defaultData: { [key: string]: any } = Object.create(null);
private _baseProperties: { appName: string; uiKind: 'web'; version: string };
private readonly supervisor = new SupervisorConnection();
private readonly devMode = this.productName.endsWith(' Dev');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as before, move to workbench.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants