Skip to content

Commit

Permalink
move tracing function to tracing package
Browse files Browse the repository at this point in the history
  • Loading branch information
sampaiodiego committed Dec 10, 2024
1 parent 9b8207f commit d1c9d1f
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion packages/core-services/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ import type { IVoipFreeSwitchService } from './types/IVoipFreeSwitchService';
import type { IVoipService } from './types/IVoipService';

export { asyncLocalStorage } from './lib/asyncLocalStorage';
export { traceInstanceMethods } from './lib/asyncMethodCallContext';
export { MeteorError, isMeteorError } from './MeteorError';
export { api } from './api';
export { EventSignatures } from './events/Events';
Expand Down
1 change: 1 addition & 0 deletions packages/models/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"dependencies": {
"@rocket.chat/model-typings": "workspace:~",
"@rocket.chat/rest-typings": "workspace:^",
"@rocket.chat/tracing": "workspace:^",
"node-rsa": "^1.1.1"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/models/src/models/BaseRaw.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { traceInstanceMethods } from '@rocket.chat/core-services';
import type { RocketChatRecordDeleted } from '@rocket.chat/core-typings';
import type { IBaseModel, DefaultFields, ResultFields, FindPaginated, InsertionModel } from '@rocket.chat/model-typings';
import { traceInstanceMethods } from '@rocket.chat/tracing';
import { ObjectId } from 'mongodb';
import type {
BulkWriteOptions,
Expand Down
2 changes: 2 additions & 0 deletions packages/tracing/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { initDatabaseTracing } from './traceDatabaseCalls';

let tracer: Tracer | undefined;

export * from './traceInstanceMethods';

export function isTracingEnabled() {
return ['yes', 'true'].includes(String(process.env.TRACING_ENABLED).toLowerCase());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { tracerActiveSpan } from '@rocket.chat/tracing';
import { tracerActiveSpan } from '.';

const getArguments = (args: any[]): any[] => {
return args.map((arg) => {
Expand Down
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9558,6 +9558,7 @@ __metadata:
"@rocket.chat/jest-presets": "workspace:~"
"@rocket.chat/model-typings": "workspace:~"
"@rocket.chat/rest-typings": "workspace:^"
"@rocket.chat/tracing": "workspace:^"
"@types/jest": "npm:~29.5.14"
"@types/node-rsa": "npm:^1.1.4"
eslint: "npm:~8.45.0"
Expand Down

0 comments on commit d1c9d1f

Please sign in to comment.