feat: Toggle telemetry with telemetry enabled env variable
This commit is contained in:
@@ -22,6 +22,7 @@ type AppConfig = {
|
|||||||
redisHost: string;
|
redisHost: string;
|
||||||
redisPort: number;
|
redisPort: number;
|
||||||
enableBullMQDashboard: boolean;
|
enableBullMQDashboard: boolean;
|
||||||
|
telemetryEnabled: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
const host = process.env.HOST || 'localhost';
|
const host = process.env.HOST || 'localhost';
|
||||||
@@ -62,6 +63,7 @@ const appConfig: AppConfig = {
|
|||||||
process.env.ENABLE_BULLMQ_DASHBOARD === 'true' ? true : false,
|
process.env.ENABLE_BULLMQ_DASHBOARD === 'true' ? true : false,
|
||||||
baseUrl,
|
baseUrl,
|
||||||
webAppUrl,
|
webAppUrl,
|
||||||
|
telemetryEnabled: process.env.TELEMETRY_ENABLED === 'false' ? false : true,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!appConfig.encryptionKey) {
|
if (!appConfig.encryptionKey) {
|
||||||
|
@@ -26,6 +26,10 @@ class Telemetry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
track(name: string, properties: apiObject) {
|
track(name: string, properties: apiObject) {
|
||||||
|
if (!appConfig.telemetryEnabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
properties = {
|
properties = {
|
||||||
...properties,
|
...properties,
|
||||||
appEnv: appConfig.appEnv,
|
appEnv: appConfig.appEnv,
|
||||||
|
Reference in New Issue
Block a user