Merge pull request #309 from automatisch/feature/telemetry-poc

feat: Implement initial version of telemetry client
This commit is contained in:
Ömer Faruk Aydın
2022-05-01 19:07:58 +02:00
committed by GitHub
3 changed files with 210 additions and 5 deletions

View File

@@ -24,6 +24,7 @@
"@graphql-tools/graphql-file-loader": "^7.3.4",
"@graphql-tools/load": "^7.5.2",
"@octokit/oauth-methods": "^1.2.6",
"@rudderstack/rudder-sdk-node": "^1.1.2",
"@slack/bolt": "3.10.0",
"@types/luxon": "^2.3.1",
"ajv-formats": "^2.1.1",

View File

@@ -0,0 +1,31 @@
import Analytics, { apiObject } from '@rudderstack/rudder-sdk-node';
const WRITE_KEY = '284Py4VgK2MsNYV7xlKzyrALx0v';
const DATA_PLANE_URL = 'https://telemetry.automatisch.io/v1/batch';
class Telemetry {
instanceId: string;
client: Analytics;
constructor() {
this.client = new Analytics(WRITE_KEY, DATA_PLANE_URL);
}
track(name: string, properties: apiObject) {
this.client.track({
userId: 'sample',
event: name,
properties,
});
}
// Example implementation of telemetry methods.
// TODO: Revise properties for the step.
// stepUpdated(key: string, appKey: string) {
// this.track('Step updated', { key, appKey });
// }
}
const telemetry = new Telemetry();
export default telemetry;