@golemio/core 1.2.19 → 1.2.20

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.
@@ -1,8 +1,9 @@
1
1
  import { HttpInstrumentation } from "@opentelemetry/instrumentation-http";
2
2
  import { IORedisInstrumentation } from "@opentelemetry/instrumentation-ioredis";
3
+ import { RedisInstrumentation } from "@opentelemetry/instrumentation-redis";
3
4
  import { ExpressInstrumentation } from "@opentelemetry/instrumentation-express";
4
5
  import { SequelizeInstrumentation } from "opentelemetry-instrumentation-sequelize";
5
6
  import { MongooseInstrumentation } from "opentelemetry-instrumentation-mongoose";
6
7
  import { AmqplibInstrumentation } from "@opentelemetry/instrumentation-amqplib";
7
8
  import { AwsInstrumentation } from "@opentelemetry/instrumentation-aws-sdk";
8
- export declare const getInstrumentation: () => (ExpressInstrumentation | HttpInstrumentation | SequelizeInstrumentation | MongooseInstrumentation | AmqplibInstrumentation | IORedisInstrumentation | AwsInstrumentation)[];
9
+ export declare const getInstrumentation: () => (ExpressInstrumentation | HttpInstrumentation | SequelizeInstrumentation | MongooseInstrumentation | AmqplibInstrumentation | IORedisInstrumentation | RedisInstrumentation | AwsInstrumentation)[];
@@ -4,6 +4,7 @@ exports.getInstrumentation = void 0;
4
4
  // Instrumentation
5
5
  const instrumentation_http_1 = require("@opentelemetry/instrumentation-http");
6
6
  const instrumentation_ioredis_1 = require("@opentelemetry/instrumentation-ioredis");
7
+ const instrumentation_redis_1 = require("@opentelemetry/instrumentation-redis");
7
8
  const instrumentation_express_1 = require("@opentelemetry/instrumentation-express");
8
9
  const opentelemetry_instrumentation_sequelize_1 = require("opentelemetry-instrumentation-sequelize");
9
10
  const opentelemetry_instrumentation_mongoose_1 = require("opentelemetry-instrumentation-mongoose");
@@ -19,6 +20,7 @@ const getInstrumentation = () => {
19
20
  new opentelemetry_instrumentation_mongoose_1.MongooseInstrumentation(configs_1.mongooseConfig),
20
21
  new instrumentation_amqplib_1.AmqplibInstrumentation(configs_1.amqplibConfig),
21
22
  new instrumentation_ioredis_1.IORedisInstrumentation(),
23
+ new instrumentation_redis_1.RedisInstrumentation(),
22
24
  new instrumentation_aws_sdk_1.AwsInstrumentation(configs_1.awsSdkConfig),
23
25
  ];
24
26
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/monitoring/opentelemetry/instrumentation/index.ts"],"names":[],"mappings":";;;AAAA,kBAAkB;AAClB,8EAA0E;AAC1E,oFAAgF;AAChF,oFAAgF;AAChF,qGAAmF;AACnF,mGAAiF;AACjF,oFAAgF;AAChF,oFAA4E;AAE5E,UAAU;AACV,uCAAqG;AAE9F,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACnC,OAAO;QACH,IAAI,gDAAsB,EAAE;QAC5B,IAAI,0CAAmB,CAAC,oBAAU,CAAC;QACnC,IAAI,kEAAwB,CAAC,yBAAe,CAAC;QAC7C,IAAI,gEAAuB,CAAC,wBAAc,CAAC;QAC3C,IAAI,gDAAsB,CAAC,uBAAa,CAAC;QACzC,IAAI,gDAAsB,EAAE;QAC5B,IAAI,4CAAkB,CAAC,sBAAY,CAAC;KACvC,CAAC;AACN,CAAC,CAAC;AAVW,QAAA,kBAAkB,sBAU7B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/monitoring/opentelemetry/instrumentation/index.ts"],"names":[],"mappings":";;;AAAA,kBAAkB;AAClB,8EAA0E;AAC1E,oFAAgF;AAChF,gFAA4E;AAC5E,oFAAgF;AAChF,qGAAmF;AACnF,mGAAiF;AACjF,oFAAgF;AAChF,oFAA4E;AAE5E,UAAU;AACV,uCAAqG;AAE9F,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACnC,OAAO;QACH,IAAI,gDAAsB,EAAE;QAC5B,IAAI,0CAAmB,CAAC,oBAAU,CAAC;QACnC,IAAI,kEAAwB,CAAC,yBAAe,CAAC;QAC7C,IAAI,gEAAuB,CAAC,wBAAc,CAAC;QAC3C,IAAI,gDAAsB,CAAC,uBAAa,CAAC;QACzC,IAAI,gDAAsB,EAAE;QAC5B,IAAI,4CAAoB,EAAE;QAC1B,IAAI,4CAAkB,CAAC,sBAAY,CAAC;KACvC,CAAC;AACN,CAAC,CAAC;AAXW,QAAA,kBAAkB,sBAW7B"}
@@ -4,10 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.useCacheMiddleware = exports.CacheMiddleware = void 0;
7
+ const apicache_plus_1 = __importDefault(require("apicache-plus"));
7
8
  const config_1 = require("../config");
8
9
  const Logger_1 = require("../Logger");
9
- const apicache_plus_1 = __importDefault(require("apicache-plus"));
10
- const ConnectionType_1 = require("./interfaces/ConnectionType");
11
10
  const RedisConnector_1 = require("./RedisConnector");
12
11
  class MyCacheMiddleware {
13
12
  constructor() {
@@ -34,7 +33,7 @@ class MyCacheMiddleware {
34
33
  }
35
34
  init() {
36
35
  if (config_1.config.redis_enable) {
37
- this.redisClient = RedisConnector_1.RedisConnector.getConnection(ConnectionType_1.ConnectionType.APICACHE);
36
+ this.redisClient = RedisConnector_1.RedisConnector.getConnection(RedisConnector_1.ConnectionType.APICACHE);
38
37
  // sets redis to apicache
39
38
  this.cacheWithRedisMiddleware = apicache_plus_1.default.options({
40
39
  defaultDuration: this.defaultCacheTtl.toString(),
@@ -1 +1 @@
1
- {"version":3,"file":"CacheMiddleware.js","sourceRoot":"","sources":["../../../src/output-gateway/redis/CacheMiddleware.ts"],"names":[],"mappings":";;;;;;AAAA,sCAAoC;AACpC,sCAAiC;AACjC,kEAAqC;AAGrC,gEAA6D;AAC7D,qDAAkD;AAElD,MAAM,iBAAiB;IAAvB;QACY,oBAAe,GAAW,QAAQ,CAAC,eAAM,CAAC,SAAS,IAAI,OAAO,EAAE,EAAE,CAAC,CAAC;QAI5E,kCAAkC;QAC1B,6BAAwB,GAAG,uBAAQ,CAAC,OAAO,CAAC;YAChD,eAAe,EAA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;QACP,IAAI,eAAM,CAAC,YAAY,EAAE;YACrB,IAAI,CAAC,WAAW,GAAG,+BAAc,CAAC,aAAa,CAAC,+BAAc,CAAC,QAAQ,CAAC,CAAC;YAEzE,yBAAyB;YACzB,IAAI,CAAC,wBAAwB,GAAG,uBAAQ,CAAC,OAAO,CAAC;gBAC7C,eAAe,EAAE,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE;gBAChD,WAAW,EAAE,IAAI,CAAC,WAAW;aAChC,CAAC,CAAC,UAAU,CAAC;SACjB;aAAM;YACH,YAAG,CAAC,IAAI,CAAC,4DAA4D,CAAC,CAAC;SAC1E;IACL,CAAC;IAEM,kBAAkB;QACrB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAOM,aAAa,CAAC,MAAwB;QACzC,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;CAYJ;AAED,MAAM,eAAe,GAAG,IAAI,iBAAiB,EAAE,CAAC;AAGvC,0CAAe;AAFxB,MAAM,kBAAkB,GAAG,CAAC,MAAwB,EAAE,EAAE,CAAC,eAAe,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;AAErE,gDAAkB"}
@@ -1,13 +1,16 @@
1
- import { Redis as RedisInstance } from "ioredis";
2
- import { ConnectionType } from "./interfaces/ConnectionType";
3
- import IRedisConnector from "./interfaces/IRedisConnector";
4
- declare class IORedisConnector implements IRedisConnector<RedisInstance> {
1
+ import { RedisClient } from "redis";
2
+ export declare enum ConnectionType {
3
+ DEFAULT = "DEFAULT",
4
+ APICACHE = "APICACHE"
5
+ }
6
+ declare class MyRedis {
5
7
  private connections;
6
- connect: () => Promise<RedisInstance>;
7
- getConnection(connectionType?: ConnectionType): RedisInstance;
8
+ connect: () => Promise<RedisClient>;
9
+ getConnection(connectionType?: ConnectionType): RedisClient;
8
10
  isConnected(connectionType?: ConnectionType): boolean;
9
11
  disconnect(): Promise<void>;
10
12
  private createConnection;
13
+ private checkOnConnect;
11
14
  }
12
- declare const RedisConnector: IORedisConnector;
15
+ declare const RedisConnector: MyRedis;
13
16
  export { RedisConnector };
@@ -12,64 +12,91 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.RedisConnector = void 0;
15
+ exports.RedisConnector = exports.ConnectionType = void 0;
16
+ const errors_1 = require("@golemio/errors");
17
+ const promises_1 = require("timers/promises");
18
+ const redis_1 = __importDefault(require("redis"));
16
19
  const config_1 = require("../config");
17
20
  const Logger_1 = require("../Logger");
18
- const errors_1 = require("@golemio/errors");
19
- const ioredis_1 = __importDefault(require("ioredis"));
20
- const ConnectionType_1 = require("./interfaces/ConnectionType");
21
- class IORedisConnector {
21
+ var ConnectionType;
22
+ (function (ConnectionType) {
23
+ ConnectionType["DEFAULT"] = "DEFAULT";
24
+ ConnectionType["APICACHE"] = "APICACHE";
25
+ })(ConnectionType = exports.ConnectionType || (exports.ConnectionType = {}));
26
+ const connectionOptions = {
27
+ [ConnectionType.DEFAULT]: {},
28
+ [ConnectionType.APICACHE]: { detect_buffers: true },
29
+ };
30
+ class MyRedis {
22
31
  constructor() {
23
32
  this.connections = new Map();
24
33
  this.connect = () => __awaiter(this, void 0, void 0, function* () {
25
- if (this.connections.has(ConnectionType_1.ConnectionType.DEFAULT)) {
26
- return this.connections.get(ConnectionType_1.ConnectionType.DEFAULT);
34
+ if (this.connections.has(ConnectionType.DEFAULT)) {
35
+ return this.connections.get(ConnectionType.DEFAULT);
27
36
  }
28
- for (const connectionType of Object.values(ConnectionType_1.ConnectionType)) {
37
+ for (const connectionType of Object.values(ConnectionType)) {
29
38
  yield this.createConnection(connectionType);
30
39
  }
31
- return this.connections.get(ConnectionType_1.ConnectionType.DEFAULT);
40
+ return this.connections.get(ConnectionType.DEFAULT);
32
41
  });
33
- this.createConnection = (connectionType = ConnectionType_1.ConnectionType.DEFAULT) => __awaiter(this, void 0, void 0, function* () {
34
- if (!config_1.config.redis_connection) {
35
- throw new errors_1.CustomError("The ENV variable redis_connection cannot be undefined.", true, this.constructor.name);
42
+ this.createConnection = (connectionType) => __awaiter(this, void 0, void 0, function* () {
43
+ try {
44
+ if (!config_1.config.redis_connection) {
45
+ throw new errors_1.CustomError("The ENV variable REDIS_CONN cannot be undefined.", true, this.constructor.name);
46
+ }
47
+ const connection = redis_1.default
48
+ .createClient(config_1.config.redis_connection, connectionOptions[connectionType])
49
+ .on("message", (message) => Logger_1.log.info(message))
50
+ .on("error", (error) => Logger_1.log.warn(error))
51
+ .on("connect", () => Logger_1.log.info("Connected to Redis!"));
52
+ this.connections.set(connectionType, connection);
53
+ // waiting for the redis client to connect
54
+ const delay = 500; // millis
55
+ const attemps = 4;
56
+ yield this.checkOnConnect(connectionType, attemps, attemps, delay);
57
+ return connection;
36
58
  }
37
- const connection = new ioredis_1.default(config_1.config.redis_connection, { lazyConnect: true });
38
- if (!connection) {
39
- throw new Error("Connection is undefined.");
59
+ catch (err) {
60
+ throw new errors_1.CustomError("Error while connecting to Redis.", false, this.constructor.name, 1001, err);
40
61
  }
41
- connection.on("error", (err) => {
42
- Logger_1.log.warn(err);
43
- });
44
- connection.on("connect", () => {
45
- Logger_1.log.info("Connected to Redis!");
46
- });
47
- yield connection.connect();
48
- this.connections.set(connectionType, connection);
62
+ });
63
+ this.checkOnConnect = (connectionType, retry, attemps, delay) => __awaiter(this, void 0, void 0, function* () {
64
+ while (retry > 0) {
65
+ if (this.isConnected(connectionType)) {
66
+ return;
67
+ }
68
+ yield (0, promises_1.setTimeout)(delay);
69
+ retry -= 1;
70
+ }
71
+ throw new Error(`Failed to connect to Redis after ${attemps * delay} millis.`);
49
72
  });
50
73
  }
51
- getConnection(connectionType = ConnectionType_1.ConnectionType.DEFAULT) {
74
+ getConnection(connectionType = ConnectionType.DEFAULT) {
52
75
  const connection = this.connections.get(connectionType);
53
76
  if (!connection) {
54
77
  throw new errors_1.CustomError("Redis connection does not exists. First call connect() method.", false, this.constructor.name, 1002);
55
78
  }
56
79
  return connection;
57
80
  }
58
- isConnected(connectionType = ConnectionType_1.ConnectionType.DEFAULT) {
81
+ isConnected(connectionType = ConnectionType.DEFAULT) {
59
82
  const connection = this.connections.get(connectionType);
60
- return !!connection && connection.status === "ready";
83
+ return !!connection && connection.connected;
61
84
  }
62
85
  disconnect() {
63
86
  return __awaiter(this, void 0, void 0, function* () {
64
87
  Logger_1.log.info("Redis disconnect called");
65
88
  for (const connection of this.connections.values()) {
66
- if (connection) {
67
- yield connection.quit();
68
- }
89
+ yield new Promise((resolve, reject) => {
90
+ connection.quit((err) => {
91
+ if (err)
92
+ reject(err);
93
+ resolve();
94
+ });
95
+ });
69
96
  }
70
97
  });
71
98
  }
72
99
  }
73
- const RedisConnector = new IORedisConnector();
100
+ const RedisConnector = new MyRedis();
74
101
  exports.RedisConnector = RedisConnector;
75
102
  //# sourceMappingURL=RedisConnector.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RedisConnector.js","sourceRoot":"","sources":["../../../src/output-gateway/redis/RedisConnector.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sCAAoC;AACpC,sCAAiC;AACjC,4CAA8C;AAC9C,sDAAwD;AACxD,gEAA6D;AAG7D,MAAM,gBAAgB;IAAtB;QACY,gBAAW,GAAuC,IAAI,GAAG,EAAE,CAAC;QAE7D,YAAO,GAAG,GAAiC,EAAE;YAChD,IAAI,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,+BAAc,CAAC,OAAO,CAAC,EAAE;gBAC9C,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,+BAAc,CAAC,OAAO,CAAE,CAAC;aACxD;YAED,KAAK,MAAM,cAAc,IAAI,MAAM,CAAC,MAAM,CAAC,+BAAc,CAAC,EAAE;gBACxD,MAAM,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;aAC/C;YAED,OAAO,IAAI,CAAC,WAAW,CAAC,GA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CAAC,CAAC,GAAG,EAAE,EAAE;wBACpB,IAAI,GAAG;4BAAE,MAAM,CAAC,GAAG,CAAC,CAAC;wBACrB,OAAO,EAAE,CAAC;oBACd,CAAC,CAAC,CAAC;gBACP,CAAC,CAAC,CAAC;aACN;QACL,CAAC;KAAA;CAuCJ;AAED,MAAM,cAAc,GAAG,IAAI,OAAO,EAAE,CAAC;AAE5B,wCAAc"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golemio/core",
3
- "version": "1.2.19",
3
+ "version": "1.2.20",
4
4
  "description": "Golemio Core Module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -77,6 +77,7 @@
77
77
  "@opentelemetry/instrumentation-express": "^0.28.0",
78
78
  "@opentelemetry/instrumentation-http": "^0.27.0",
79
79
  "@opentelemetry/instrumentation-ioredis": "^0.28.0",
80
+ "@opentelemetry/instrumentation-redis": "^0.29.0",
80
81
  "@opentelemetry/resources": "^1.2.0",
81
82
  "@opentelemetry/sdk-trace-base": "^1.2.0",
82
83
  "@opentelemetry/sdk-trace-node": "^1.2.0",
@@ -116,6 +117,7 @@
116
117
  "path-to-regexp": "^6.2.0",
117
118
  "pg": "^8.6.0",
118
119
  "prom-client": "^14.0.0",
120
+ "redis": "^3.1.1",
119
121
  "request": "2.88.0",
120
122
  "request-promise": "^4.2.5",
121
123
  "sequelize": "^6.21.2",
@@ -1,4 +0,0 @@
1
- export declare enum ConnectionType {
2
- DEFAULT = "DEFAULT",
3
- APICACHE = "APICACHE"
4
- }
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ConnectionType = void 0;
4
- var ConnectionType;
5
- (function (ConnectionType) {
6
- ConnectionType["DEFAULT"] = "DEFAULT";
7
- ConnectionType["APICACHE"] = "APICACHE";
8
- })(ConnectionType = exports.ConnectionType || (exports.ConnectionType = {}));
9
- //# sourceMappingURL=ConnectionType.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ConnectionType.js","sourceRoot":"","sources":["../../../../src/output-gateway/redis/interfaces/ConnectionType.ts"],"names":[],"mappings":";;;AAAA,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,qCAAmB,CAAA;IACnB,uCAAqB,CAAA;AACzB,CAAC,EAHW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAGzB"}
@@ -1,6 +0,0 @@
1
- export default interface IRedisConnector<T> {
2
- connect(): Promise<T>;
3
- getConnection(): T;
4
- isConnected(): boolean;
5
- disconnect(): void;
6
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=IRedisConnector.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IRedisConnector.js","sourceRoot":"","sources":["../../../../src/output-gateway/redis/interfaces/IRedisConnector.ts"],"names":[],"mappings":""}