feat: Implement telemetry for connection creation and updates
This commit is contained in:
@@ -5,6 +5,7 @@ import Base from './base';
|
||||
import User from './user';
|
||||
import appConfig from '../config/app';
|
||||
import { IJSONObject } from '@automatisch/types';
|
||||
import Telemetry from '../helpers/telemetry';
|
||||
|
||||
class Connection extends Base {
|
||||
id!: string;
|
||||
@@ -87,6 +88,16 @@ class Connection extends Base {
|
||||
async $afterFind(): Promise<void> {
|
||||
this.decryptData();
|
||||
}
|
||||
|
||||
async $afterInsert(queryContext: QueryContext) {
|
||||
await super.$afterInsert(queryContext);
|
||||
Telemetry.connectionCreated(this);
|
||||
}
|
||||
|
||||
async $afterUpdate(opt: ModelOptions, queryContext: QueryContext) {
|
||||
await super.$afterUpdate(opt, queryContext);
|
||||
Telemetry.connectionUpdated(this);
|
||||
}
|
||||
}
|
||||
|
||||
export default Connection;
|
||||
|
Reference in New Issue
Block a user