Skip to content

Commit 432e9ad

Browse files
committed
Revert "Remove indirection of metrics"
This reverts commit bea68a4.
1 parent b1f2a1f commit 432e9ad

File tree

1 file changed

+4
-25
lines changed

1 file changed

+4
-25
lines changed

packages/app/src/sandbox/utils/metrics.ts

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -108,44 +108,23 @@ getGlobal().measurements = {
108108
getMeasurements,
109109
};
110110

111-
const MEASUREMENT_API = `https://col.ops.csb.dev/data/sandpack`;
111+
const MEASUREMENT_API = `https://30vlq6h5qc.execute-api.eu-west-1.amazonaws.com/prod/metrics`;
112112

113113
export function persistMeasurements(data: {
114114
sandboxId: string;
115115
cacheUsed: boolean;
116116
browser: string;
117117
version: string;
118118
}) {
119-
const body = [
120-
{
121-
measurement: 'load_times',
122-
tags: {
123-
browser: data.browser,
124-
sandbox_id: data.sandboxId,
125-
cache_used: data.cacheUsed,
126-
version: data.version,
127-
},
128-
fields: {
129-
transpilation: measurements.transpilation,
130-
evaluation: measurements.evaluation,
131-
external_resources: measurements['external-resources'],
132-
compilation: measurements.compilation,
133-
boot: measurements.boot,
134-
total: measurements.total,
135-
dependencies: measurements.dependencies,
136-
},
137-
},
138-
];
139-
140119
if (process.env.NODE_ENV === 'development' || process.env.STAGING) {
141-
// eslint-disable-next-line
142-
console.log(body);
143120
return Promise.resolve();
144121
}
145122

123+
const finalData = { ...data, ...measurements };
124+
146125
return fetch(MEASUREMENT_API, {
147126
method: 'POST',
148-
body: JSON.stringify(body),
127+
body: JSON.stringify(finalData),
149128
headers: {
150129
Accept: 'application/json',
151130
'Content-Type': 'application/json',

0 commit comments

Comments
 (0)