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