@yolo-croket-dev/core 1.7.2 → 1.7.4-datadog.0

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.
@@ -48,7 +48,7 @@ async function AmqpHandler(client, messagePattern, payload) {
48
48
  msaLogger.error('NOT_EXISTS_MESSAGE_PATTERN', { traceId: ((_b = payload === null || payload === void 0 ? void 0 : payload.param) === null || _b === void 0 ? void 0 : _b.traceId) || '-' }, { err });
49
49
  throw new HttpExceptionCustom('해당 메시지 패턴은 존재하지 않습니다.', 404, 'There is no matching message handler defined in the remote service.', {
50
50
  type: 'NOT_EXISTS_MESSAGE_PATTERN',
51
- message: '해당 메시지 패턴은 존재하지 않습니다.',
51
+ message: `${messagePattern} 해당 메시지 패턴은 존재하지 않습니다.`,
52
52
  });
53
53
  }
54
54
  else {
@@ -157,7 +157,7 @@ let LoggingServiceInterceptor = class LoggingServiceInterceptor {
157
157
  }));
158
158
  }
159
159
  };
160
- exports.LoggingServiceInterceptor = LoggingServiceInterceptor;
161
- exports.LoggingServiceInterceptor = LoggingServiceInterceptor = __decorate([
160
+ LoggingServiceInterceptor = __decorate([
162
161
  (0, common_1.Injectable)()
163
162
  ], LoggingServiceInterceptor);
163
+ exports.LoggingServiceInterceptor = LoggingServiceInterceptor;
@@ -31,6 +31,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
31
31
  var __metadata = (this && this.__metadata) || function (k, v) {
32
32
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
33
33
  };
34
+ var __importDefault = (this && this.__importDefault) || function (mod) {
35
+ return (mod && mod.__esModule) ? mod : { "default": mod };
36
+ };
34
37
  Object.defineProperty(exports, "__esModule", { value: true });
35
38
  exports.RPCInterceptor = void 0;
36
39
  /* eslint-disable @typescript-eslint/no-explicit-any */
@@ -40,6 +43,7 @@ const core_1 = require("@nestjs/core");
40
43
  const rxjs_1 = require("rxjs");
41
44
  const operators_1 = require("rxjs/operators");
42
45
  const msa_logger_1 = __importStar(require("@yolo-croket-dev/msa-logger"));
46
+ const dd_trace_1 = __importDefault(require("dd-trace"));
43
47
  // import Logger from '@yolo-croket-dev/logger';
44
48
  const functions_1 = require("../functions");
45
49
  const exceptions_1 = require("../exceptions");
@@ -181,7 +185,7 @@ let RPCInterceptor = class RPCInterceptor {
181
185
  }
182
186
  const noAck = message.fields.routingKey.includes('ASYNC');
183
187
  let localErrorProcessor = async (err) => {
184
- var _a;
188
+ var _a, _b;
185
189
  const errMsg = err.response ? err.response : err.message;
186
190
  const status = err.status ? err.status : 500;
187
191
  const errType = err.errType;
@@ -190,6 +194,9 @@ let RPCInterceptor = class RPCInterceptor {
190
194
  const errInfo = err.errInfo;
191
195
  const duration = Date.now() - now;
192
196
  let isAck = false;
197
+ if (process.env.DD_AGENT_HOST && process.env.DD_AGENT_HOST.startsWith('datadog-agent-agent')) {
198
+ (_a = dd_trace_1.default.scope().active()) === null || _a === void 0 ? void 0 : _a.setTag('error', err);
199
+ }
193
200
  /** 파일 객체 처리 */
194
201
  (0, functions_1.reWriteFileValue)(arg === null || arg === void 0 ? void 0 : arg.file);
195
202
  const abstractAmqpHandlerData = {
@@ -233,7 +240,7 @@ let RPCInterceptor = class RPCInterceptor {
233
240
  }
234
241
  const messageContent = message.content.toString();
235
242
  /** 파일 객체 처리 */
236
- (0, functions_1.reWriteFileValue)((_a = messageContent === null || messageContent === void 0 ? void 0 : messageContent.data) === null || _a === void 0 ? void 0 : _a.file);
243
+ (0, functions_1.reWriteFileValue)((_b = messageContent === null || messageContent === void 0 ? void 0 : messageContent.data) === null || _b === void 0 ? void 0 : _b.file);
237
244
  // logger.debug(`<= (error:${traceId}): ${JSON.stringify(sendMessage.toString())}`, {
238
245
  // ...logParam,
239
246
  // duration,
@@ -304,9 +311,9 @@ let RPCInterceptor = class RPCInterceptor {
304
311
  }));
305
312
  }
306
313
  };
307
- exports.RPCInterceptor = RPCInterceptor;
308
- exports.RPCInterceptor = RPCInterceptor = __decorate([
314
+ RPCInterceptor = __decorate([
309
315
  (0, common_1.Injectable)(),
310
316
  __metadata("design:paramtypes", [core_1.Reflector,
311
317
  graceful_shutdown_service_1.GracefulShutdownService])
312
318
  ], RPCInterceptor);
319
+ exports.RPCInterceptor = RPCInterceptor;
@@ -18,10 +18,9 @@ var ErrActionTypeEnum;
18
18
  ErrActionTypeEnum["LEGACY_SHOW_TOAST"] = "LEGACY_SHOW_TOAST";
19
19
  ErrActionTypeEnum["FORCE_UPDATE"] = "FORCE_UPDATE";
20
20
  ErrActionTypeEnum["UPDATE_ACCESS_TOKEN"] = "UPDATE_ACCESS_TOKEN";
21
- })(ErrActionTypeEnum || (exports.ErrActionTypeEnum = ErrActionTypeEnum = {}));
21
+ })(ErrActionTypeEnum = exports.ErrActionTypeEnum || (exports.ErrActionTypeEnum = {}));
22
22
  class ErrAction {
23
23
  }
24
- exports.ErrAction = ErrAction;
25
24
  __decorate([
26
25
  (0, swagger_1.ApiProperty)({
27
26
  description: '액션 타입',
@@ -58,9 +57,9 @@ __decorate([
58
57
  }),
59
58
  __metadata("design:type", String)
60
59
  ], ErrAction.prototype, "webViewUrl", void 0);
60
+ exports.ErrAction = ErrAction;
61
61
  class ErrInfo {
62
62
  }
63
- exports.ErrInfo = ErrInfo;
64
63
  __decorate([
65
64
  (0, swagger_1.ApiProperty)({
66
65
  description: '에러 종류 식별자',
@@ -82,3 +81,4 @@ __decorate([
82
81
  }),
83
82
  __metadata("design:type", ErrAction)
84
83
  ], ErrInfo.prototype, "action", void 0);
84
+ exports.ErrInfo = ErrInfo;
@@ -11,11 +11,11 @@ const common_1 = require("@nestjs/common");
11
11
  const graceful_shutdown_service_1 = require("./graceful-shutdown.service");
12
12
  let GracefulShutdownModule = class GracefulShutdownModule {
13
13
  };
14
- exports.GracefulShutdownModule = GracefulShutdownModule;
15
- exports.GracefulShutdownModule = GracefulShutdownModule = __decorate([
14
+ GracefulShutdownModule = __decorate([
16
15
  (0, common_1.Global)(),
17
16
  (0, common_1.Module)({
18
17
  providers: [graceful_shutdown_service_1.GracefulShutdownService],
19
18
  exports: [graceful_shutdown_service_1.GracefulShutdownService],
20
19
  })
21
20
  ], GracefulShutdownModule);
21
+ exports.GracefulShutdownModule = GracefulShutdownModule;
@@ -1,7 +1,7 @@
1
1
  import { RmqOptions, ServerRMQ } from '@nestjs/microservices';
2
2
  import { Channel } from 'amqp-connection-manager';
3
3
  import { ConsumeMessage } from 'amqplib';
4
- export type GracefulRmqOptions = RmqOptions['options'] & {
4
+ export declare type GracefulRmqOptions = RmqOptions['options'] & {
5
5
  waitingEndingHandlersTimeoutMs?: number;
6
6
  waitingEndingHandlersIntervalMs?: number;
7
7
  };
@@ -88,7 +88,7 @@ let GracefulShutdownService = class GracefulShutdownService {
88
88
  }
89
89
  }
90
90
  };
91
- exports.GracefulShutdownService = GracefulShutdownService;
92
- exports.GracefulShutdownService = GracefulShutdownService = __decorate([
91
+ GracefulShutdownService = __decorate([
93
92
  (0, common_1.Injectable)()
94
93
  ], GracefulShutdownService);
94
+ exports.GracefulShutdownService = GracefulShutdownService;
@@ -15,10 +15,10 @@ const redisProvider = {
15
15
  };
16
16
  let RedisModule = class RedisModule {
17
17
  };
18
- exports.RedisModule = RedisModule;
19
- exports.RedisModule = RedisModule = __decorate([
18
+ RedisModule = __decorate([
20
19
  (0, common_1.Module)({
21
20
  providers: [redisProvider],
22
21
  exports: [redisProvider],
23
22
  })
24
23
  ], RedisModule);
24
+ exports.RedisModule = RedisModule;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yolo-croket-dev/core",
3
- "version": "1.7.2",
3
+ "version": "1.7.4-datadog.0",
4
4
  "author": "Yolo Co., Ltd.",
5
5
  "description": "Yolo commonization module",
6
6
  "main": "index.js",
@@ -28,6 +28,7 @@
28
28
  "devDependencies": {
29
29
  "@types/node": "^16.11.9",
30
30
  "@types/randomstring": "^1.1.8",
31
- "@types/uuid": "^8.3.4"
31
+ "@types/uuid": "^8.3.4",
32
+ "dd-trace": "^5.25.0"
32
33
  }
33
34
  }
@@ -31,8 +31,8 @@ let ValidationPipe = class ValidationPipe {
31
31
  return value;
32
32
  }
33
33
  };
34
- exports.ValidationPipe = ValidationPipe;
35
- exports.ValidationPipe = ValidationPipe = __decorate([
34
+ ValidationPipe = __decorate([
36
35
  (0, common_1.Injectable)(),
37
36
  __metadata("design:paramtypes", [Object])
38
37
  ], ValidationPipe);
38
+ exports.ValidationPipe = ValidationPipe;