Skip to content

Commit acae8de

Browse files
Lower fetch priority of metrics (#20158)
* Minor improvements to metrics requests * Fix builds
1 parent a1ec400 commit acae8de

File tree

7 files changed

+15
-8
lines changed

7 files changed

+15
-8
lines changed

components/dashboard/src/start/StartWorkspace.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export function parseProps(workspaceId: string, search?: string): StartWorkspace
5555
const runsInIFrame = window.top !== window.self;
5656
return {
5757
workspaceId,
58-
runsInIFrame: window.top !== window.self,
58+
runsInIFrame,
5959
// Either:
6060
// - not_found: we were sent back from a workspace cluster/IDE URL where we expected a workspace to be running but it wasn't because either:
6161
// - this is a (very) old tab and the workspace already timed out
@@ -228,7 +228,7 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
228228
return;
229229
}
230230
// TODO: Remove this once we use `useStartWorkspaceMutation`
231-
// Start listening too instance updates - and explicitly query state once to guarantee we get at least one update
231+
// Start listening to instance updates - and explicitly query state once to guarantee we get at least one update
232232
// (needed for already started workspaces, and not hanging in 'Starting ...' for too long)
233233
this.fetchWorkspaceInfo(result.workspace?.status?.instanceId);
234234
} catch (error) {

components/gitpod-protocol/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"mocha": "^10.2.0",
3333
"rimraf": "^2.6.2",
3434
"ts-node": "^10.4.0",
35-
"typescript": "~4.4.2",
35+
"typescript": "^5.5.4",
3636
"typescript-parser": "^2.6.1"
3737
},
3838
"scripts": {

components/gitpod-protocol/src/metrics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ export class MetricsReporter {
477477
}
478478
this.sendQueue = this.sendQueue.then(async () => {
479479
try {
480-
const response = await fetch(request.url, request);
480+
const response = await fetch(request.url, { ...request, priority: "low" });
481481
if (!response.ok) {
482482
this.options.log.error(
483483
`metrics: endpoint responded with ${response.status} ${response.statusText}`,

components/gitpod-protocol/tsconfig.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@
1010
"downlevelIteration": true,
1111
"module": "commonjs",
1212
"moduleResolution": "node",
13-
"target": "es6",
13+
"target": "ES2018",
1414
"jsx": "react",
1515
"lib": [
1616
"es6",
17-
"es2016",
17+
"es2018",
1818
"dom",
19-
"esnext.asynciterable"
19+
"ES2018.Regexp",
20+
"DOM.AsyncIterable"
2021
],
2122
"sourceMap": true,
2223
"declaration": true,

components/supervisor/frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"css-loader": "^6.8.1",
2424
"source-map-loader": "^4.0.1",
2525
"style-loader": "^3.3.3",
26-
"typescript": "~4.4.2",
26+
"typescript": "^5.5.4",
2727
"webpack": "^5.88.2",
2828
"webpack-cli": "^5.1.4"
2929
},

components/supervisor/frontend/src/ide/ide-metrics-service-client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export class IDEMetricsServiceClient {
7070
method: "POST",
7171
body: JSON.stringify(params),
7272
credentials: "omit",
73+
priority: "low",
7374
});
7475
if (!response.ok) {
7576
const data = await response.json(); // { code: number; message: string; }

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15198,6 +15198,11 @@ typescript@^5.5.4:
1519815198
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.4.tgz#d9852d6c82bad2d2eda4fd74a5762a8f5909e9ba"
1519915199
integrity sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==
1520015200

15201+
typescript@^5.5.4:
15202+
version "5.5.4"
15203+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.4.tgz#d9852d6c82bad2d2eda4fd74a5762a8f5909e9ba"
15204+
integrity sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==
15205+
1520115206
ua-parser-js@^1.0.36:
1520215207
version "1.0.36"
1520315208
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-1.0.36.tgz#a9ab6b9bd3a8efb90bb0816674b412717b7c428c"

0 commit comments

Comments
 (0)