Skip to content

Commit ca3a1fe

Browse files
committed
instance info into telemetry
1 parent 4480aaa commit ca3a1fe

4 files changed

Lines changed: 12 additions & 6 deletions

File tree

packages/browser-tests/cypress/integration/console/telemetry.spec.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe("telemetry config", () => {
2222
cy.wait("@telemetryConfig").then(({ response }) => {
2323
const columnNames = response.body.columns.map((c) => c.name);
2424
expect(response.statusCode).to.equal(200);
25-
["id", "enabled", "version", "os", "package"].forEach((name) => {
25+
["id", "enabled", "version", "os", "package", "instance_name", "instance_type", "instance_desc"].forEach((name) => {
2626
expect(columnNames).to.include(name);
2727
});
2828
expect(response.body.dataset[0][0]).to.be.string;
@@ -34,6 +34,9 @@ describe("telemetry config", () => {
3434
expect(typeof response.body.dataset[0][4]).to.satisfy(
3535
(v) => v === null || typeof v === "string"
3636
);
37+
expect(response.body.dataset[0][5]).to.be.string;
38+
expect(response.body.dataset[0][6]).to.be.string;
39+
expect(response.body.dataset[0][7]).to.be.string;
3740
});
3841
});
3942
});
@@ -62,7 +65,7 @@ describe("telemetry enabled", () => {
6265
it("should start telemetry when enabled", () => {
6366
cy.wait("@telemetryConfig").then(({ response }) => {
6467
cy.wait("@addTelemetry").then(({ request }) => {
65-
const payload = JSON.parse(request.body);
68+
const payload = request.body;
6669
expect(payload.id).to.equal(response.body.dataset[0][0]);
6770
expect(payload.version).to.equal(response.body.dataset[0][2]);
6871
expect(payload.os).to.equal(response.body.dataset[0][3]);

packages/browser-tests/questdb

Submodule questdb updated 30 files

packages/web-console/src/store/Telemetry/epics.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,14 @@ export const getRemoteConfig: Epic<StoreAction, TelemetryAction, StoreShape> = (
101101
switchMap(([_, state]) => {
102102
const config = selectors.telemetry.getConfig(state)
103103

104-
const isEE = getValue(StoreKey.RELEASE_TYPE) === "EE"
105-
if (isEE) {
104+
const releaseType = getValue(StoreKey.RELEASE_TYPE);
105+
if (releaseType === "EE" || config?.enabled) {
106106
fetch(`${API}/add-ent`, {
107107
method: "POST",
108108
headers: {
109109
"Content-Type": "application/json",
110110
},
111-
body: JSON.stringify(config),
111+
body: JSON.stringify({ ...config, releaseType }),
112112
}).catch( () => {
113113
})
114114
}

packages/web-console/src/store/Telemetry/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ export type TelemetryConfigShape = Readonly<{
2828
version: string
2929
os: string
3030
package: string
31+
instance_name: string
32+
instance_type: string
33+
instance_desc: string
3134
}>
3235

3336
export type TelemetryRemoteConfigShape = Readonly<{

0 commit comments

Comments
 (0)