feat: Add service type to telemetry data
This commit is contained in:
@@ -18,6 +18,7 @@ class Telemetry {
|
||||
organizationId: string;
|
||||
instanceId: string;
|
||||
client: Analytics;
|
||||
serviceType: string;
|
||||
|
||||
constructor() {
|
||||
this.client = new Analytics(WRITE_KEY, DATA_PLANE_URL);
|
||||
@@ -25,6 +26,10 @@ class Telemetry {
|
||||
this.instanceId = instanceId();
|
||||
}
|
||||
|
||||
setServiceType(type: string) {
|
||||
this.serviceType = type;
|
||||
}
|
||||
|
||||
track(name: string, properties: apiObject) {
|
||||
if (!appConfig.telemetryEnabled) {
|
||||
return;
|
||||
@@ -131,6 +136,7 @@ class Telemetry {
|
||||
this.track('diagnosticInfo', {
|
||||
automatischVersion: appConfig.version,
|
||||
serveWebAppSeparately: appConfig.serveWebAppSeparately,
|
||||
serviceType: this.serviceType,
|
||||
operatingSystem: {
|
||||
type: os.type(),
|
||||
version: os.version(),
|
||||
|
@@ -1,6 +1,9 @@
|
||||
import app from './app';
|
||||
import appConfig from './config/app';
|
||||
import logger from './helpers/logger';
|
||||
import telemetry from './helpers/telemetry';
|
||||
|
||||
telemetry.setServiceType('main');
|
||||
|
||||
const port = appConfig.port;
|
||||
|
||||
|
@@ -1,2 +1,5 @@
|
||||
import './config/orm';
|
||||
export { worker } from './workers/processor';
|
||||
import telemetry from './helpers/telemetry';
|
||||
|
||||
telemetry.setServiceType('worker');
|
||||
|
Reference in New Issue
Block a user