@yolo-croket-dev/core 1.7.4-datadog.11 → 1.7.4-datadog.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,6 +28,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
28
28
  __setModuleDefault(result, mod);
29
29
  return result;
30
30
  };
31
+ var __importDefault = (this && this.__importDefault) || function (mod) {
32
+ return (mod && mod.__esModule) ? mod : { "default": mod };
33
+ };
31
34
  Object.defineProperty(exports, "__esModule", { value: true });
32
35
  exports.LoggingServiceInterceptor = void 0;
33
36
  /* eslint-disable @typescript-eslint/no-explicit-any */
@@ -35,9 +38,11 @@ exports.LoggingServiceInterceptor = void 0;
35
38
  const common_1 = require("@nestjs/common");
36
39
  const msa_logger_1 = __importStar(require("@yolo-croket-dev/msa-logger"));
37
40
  const operators_1 = require("rxjs/operators");
41
+ const dd_trace_1 = __importDefault(require("dd-trace"));
38
42
  const { SERVER_NAME } = process.env;
39
43
  const msaLogger = new msa_logger_1.default(msa_logger_1.ServerTypeEnum.SERVICE);
40
44
  const MAX_CUT_LENGTH = 500;
45
+ dd_trace_1.default.init({ service: SERVER_NAME });
41
46
  let LoggingServiceInterceptor = class LoggingServiceInterceptor {
42
47
  keyCutter(data) {
43
48
  try {
@@ -120,6 +125,9 @@ let LoggingServiceInterceptor = class LoggingServiceInterceptor {
120
125
  },
121
126
  });
122
127
  })).pipe((0, operators_1.catchError)((error) => {
128
+ var _a;
129
+ /** 에러가 있다면 */
130
+ (_a = dd_trace_1.default.scope().active()) === null || _a === void 0 ? void 0 : _a.setTag('error', error);
123
131
  msaLogger.printExceptionFliterService({
124
132
  traceId,
125
133
  errInfo: {
@@ -234,8 +234,6 @@ let RPCInterceptor = class RPCInterceptor {
234
234
  const messageContent = message.content.toString();
235
235
  /** 파일 객체 처리 */
236
236
  (0, functions_1.reWriteFileValue)((_a = messageContent === null || messageContent === void 0 ? void 0 : messageContent.data) === null || _a === void 0 ? void 0 : _a.file);
237
- // msaLogger.traceError('RPCException error', { traceId: execInterceptor.traceId }, );
238
- console.error({ error: { message: errMsg, stack: err.stack ? err.stack : '', type: 'RpcExceptionsHandler' } });
239
237
  // logger.debug(`<= (error:${traceId}): ${JSON.stringify(sendMessage.toString())}`, {
240
238
  // ...logParam,
241
239
  // duration,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yolo-croket-dev/core",
3
- "version": "1.7.4-datadog.11",
3
+ "version": "1.7.4-datadog.12",
4
4
  "author": "Yolo Co., Ltd.",
5
5
  "description": "Yolo commonization module",
6
6
  "main": "index.js",
@@ -21,6 +21,7 @@
21
21
  "@yolo-croket-dev/redis": "^1.0.23",
22
22
  "@yolo-croket-dev/swagger": "^0.0.7",
23
23
  "axios": "^1.1.3",
24
+ "dd-trace": "^5.25.0",
24
25
  "randomstring": "^1.2.2",
25
26
  "rxjs": "^7.4.0",
26
27
  "uuid": "^8.3.2"