Skip to content
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

[code browser] measure all sessions vs errored sessions #12702

Merged
merged 3 commits into from
Sep 16, 2022

Conversation

filiptronicek
Copy link
Member

@filiptronicek filiptronicek commented Sep 6, 2022

Description

This PR advances on the changes made in #12222 and contributes a new metric field: gitpod_vscode_web_load_total, which will help in discovering how often (percentage-wise) errors happen in VS Code Browser, as described in #12107 (comment).

Related Issue(s)

Relates #12107

Changes done in the VS Code Browser workbench: gitpod-io/openvscode-server#428.

The query would look something like this:

sum(rate(gitpod_vscode_web_load_total{status='failed'}[2m]))/sum(rate(gitpod_vscode_web_load_total{status='loading'}[2m]))

How to test

Do a little bit of trolling (throw errors in VS Code Browser)

  • Open the preview environment of this PR
  • Select VS Code Browser (Insiders) as your IDE
  • Open a workspace within the preview environment

Verify with Grafana

  • Start a new workspace with this PR
  • Run ./dev/preview/portforward-monitoring-satellite.sh -c harvester
  • Open port 3000

Release Notes

NONE

Documentation

Werft options:

  • /werft with-preview

@filiptronicek filiptronicek requested a review from a team September 6, 2022 16:23
@filiptronicek filiptronicek changed the title [code browser]: Measure all sessions vs errored sessions [code browser] measure all sessions vs errored sessions Sep 6, 2022
@filiptronicek filiptronicek force-pushed the filiptronicek/vscode-in-browser-12107 branch from 061a53c to 5864861 Compare September 6, 2022 16:35
@filiptronicek
Copy link
Member Author

filiptronicek commented Sep 6, 2022

/werft run

👍 started the job as gitpod-build-filiptronicek-vscode-in-browser-12107.2
(with .werft/ from main)

@andreafalzetti
Copy link
Contributor

andreafalzetti commented Sep 6, 2022

I am following the how-to-test steps, but on no. 3 I am confused on what should I see? Grafana?

At the moment, I get an empty page on :3000 🤔

My steps:

  1. Open gitpod.io for this PR
  2. Run ./dev/preview/portforward-monitoring-satellite.sh -c harvester
  3. Open port 3000

And I get this:

What am I missing?

@filiptronicek
Copy link
Member Author

filiptronicek commented Sep 6, 2022

Thanks for looking at the PR, @andreafalzetti! Not quite sure what is the problem here. I assumed Grafana would be accessible the same way it was on #12222. @mustard-mh did you do any special config to get it to work 🤔?

@mustard-mh
Copy link
Contributor

@andreafalzetti @filiptronicek You need to visit Prometheus, which forwarded port is 9090

@filiptronicek filiptronicek force-pushed the filiptronicek/vscode-in-browser-12107 branch from 5864861 to 5cbe872 Compare September 8, 2022 16:31
@roboquat roboquat added size/M and removed size/S labels Sep 8, 2022
@filiptronicek filiptronicek force-pushed the filiptronicek/vscode-in-browser-12107 branch from 5cbe872 to 7ee1dd9 Compare September 8, 2022 16:50
@roboquat roboquat added size/L and removed size/M labels Sep 8, 2022
@filiptronicek filiptronicek force-pushed the filiptronicek/vscode-in-browser-12107 branch from 7ee1dd9 to f806270 Compare September 8, 2022 17:05
@@ -8,7 +8,8 @@ import { serverUrl } from '../shared/urls';

export enum MetricsName {
SupervisorFrontendClientTotal = "gitpod_supervisor_frontend_client_total",
SupervisorFrontendErrorTotal = "gitpod_supervisor_frontend_error_total"
SupervisorFrontendErrorTotal = "gitpod_supervisor_frontend_error_total",
SupervisorFrontendLoadTotal = "gitpod_vscode_web_load_total",
Copy link
Member Author

Choose a reason for hiding this comment

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

We introduced a new metric: gitpod_vscode_web_load_total for measuring the percentage of failed loads.

Copy link
Member Author

Choose a reason for hiding this comment

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

Name: "gitpod_vscode_web_load_total",
Help: "Total count of supervisor frontend client loading / errored windows",
Labels: []config.LabelAllowList{
{
Name: "status",
AllowValues: []string{"loading", "failed"},
},
},
},

this metric can have two different types: loading and error.

Copy link
Member

Choose a reason for hiding this comment

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

supervisor-frontend should be reverted, we should try to decouple metrics in VS Code Web workbench and here, and work on them separately. I think this PR should not have any changes in supervisor. cc @mustard-mh

@filiptronicek filiptronicek force-pushed the filiptronicek/vscode-in-browser-12107 branch 2 times, most recently from 1c325b9 to bc47002 Compare September 8, 2022 17:08
@filiptronicek
Copy link
Member Author

filiptronicek commented Sep 8, 2022

/werft run with-clean-slate

👍 started the job as gitpod-build-filiptronicek-vscode-in-browser-12107.8
(with .werft/ from main)

@filiptronicek filiptronicek force-pushed the filiptronicek/vscode-in-browser-12107 branch from bc47002 to 7fae1c5 Compare September 11, 2022 10:58
@mustard-mh mustard-mh force-pushed the filiptronicek/vscode-in-browser-12107 branch from d7afb80 to df74f6b Compare September 14, 2022 18:07
@mustard-mh
Copy link
Contributor

Tested with block workbench/workbench.web.main.js

Before Block After Block
image image

And metrics data report works

image

@mustard-mh mustard-mh marked this pull request as ready for review September 15, 2022 07:36
@mustard-mh
Copy link
Contributor

mustard-mh commented Sep 15, 2022

I will revert debug commit and approve this PR and openvscode-server one gitpod-io/openvscode-server#428. cc @akosyakov

@akosyakov
Copy link
Member

@mustard-mh Can we add a new row to https://grafana.gitpod.io/d/oLzOteZ4z/vs-code-browser-overview?orgId=1 for VS Code Web Workbench with tables for failure ratio?

@mustard-mh mustard-mh force-pushed the filiptronicek/vscode-in-browser-12107 branch from df74f6b to f791252 Compare September 15, 2022 15:18
@roboquat roboquat added size/S and removed size/L labels Sep 15, 2022
@mustard-mh
Copy link
Contributor

Could you help test this PR? @iQQBot

@@ -71,7 +71,8 @@ RUN yarn --cwd extensions compile \
# Check pkg/blobserve/blobserve.go, `inlineVars` method
RUN cp /vscode-web/out/vs/gitpod/browser/workbench/workbench.html /vscode-web/index.html \
&& cp /vscode-web/out/vs/gitpod/browser/workbench/callback.html /vscode-web/callback.html \
&& sed -i -e 's#static/##g' /vscode-web/index.html
&& sed -i -e 's#static/##g' /vscode-web/index.html \
&& sed -i -e "s/{{VERSION}}/$CODE_COMMIT/g" /vscode-web/index.html
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we include CODE_QUALITY here? like stable-commitHash or insider-commitHash ?

@mustard-mh
Copy link
Contributor

@mustard-mh Can we add a new row to https://grafana.gitpod.io/d/oLzOteZ4z/vs-code-browser-overview?orgId=1 for VS Code Web Workbench with tables for failure ratio?

Will do it in follow PR

@mustard-mh mustard-mh force-pushed the filiptronicek/vscode-in-browser-12107 branch from ad1cb4f to 79171ad Compare September 16, 2022 05:53
filiptronicek and others added 3 commits September 16, 2022 05:55
Move remainder of IDE metrics to under OpenVSCode Server workbench

Co-authored-by: Anton Kosyakov <anton@gitpod.io>
Co-authored-by: mustard <mhqnwt@gmail.com>
@mustard-mh mustard-mh force-pushed the filiptronicek/vscode-in-browser-12107 branch from 79171ad to 92cb119 Compare September 16, 2022 05:55
Copy link
Contributor

@iQQBot iQQBot left a comment

Choose a reason for hiding this comment

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

Check it and it works like a charm 🎉

image

image

image

image

image

/hold
need remove debug commit

@mustard-mh mustard-mh force-pushed the filiptronicek/vscode-in-browser-12107 branch from 92cb119 to a11cdfb Compare September 16, 2022 06:13
@iQQBot
Copy link
Contributor

iQQBot commented Sep 16, 2022

Next step I think we can

  1. add instanceId and userId in window.gitpod object, then workbench page can use it.
  2. modify loader.js to add onerror handler so that we can observe AMD lazy load script load error.

@iQQBot
Copy link
Contributor

iQQBot commented Sep 16, 2022

/unhold

@roboquat roboquat merged commit ac16572 into main Sep 16, 2022
@roboquat roboquat deleted the filiptronicek/vscode-in-browser-12107 branch September 16, 2022 06:46
@mustard-mh
Copy link
Contributor

Thank you @iQQBot

@@ -10,7 +10,8 @@ const commit = require('../../config.json').commit;

export enum MetricsName {
SupervisorFrontendClientTotal = "gitpod_supervisor_frontend_client_total",
SupervisorFrontendErrorTotal = "gitpod_supervisor_frontend_error_total"
SupervisorFrontendErrorTotal = "gitpod_supervisor_frontend_error_total",
SupervisorFrontendLoadTotal = "gitpod_vscode_web_load_total",
Copy link
Member

Choose a reason for hiding this comment

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

@mustard-mh I don't think supervisor frontend should care about it.

@roboquat roboquat added deployed: IDE IDE change is running in production deployed Change is completely running in production labels Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: IDE IDE change is running in production deployed Change is completely running in production editor: code (browser) release-note-none size/S team: IDE
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants