@golemio/core 1.2.8-dev.529318188 → 1.2.9-dev.533136017
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.
- package/dist/integration-engine/queueprocessors/QueueProcessor.d.ts +6 -0
- package/dist/integration-engine/queueprocessors/QueueProcessor.js +22 -2
- package/dist/integration-engine/queueprocessors/QueueProcessor.js.map +1 -1
- package/dist/monitoring/opentelemetry/instrumentation/configs/amqplib.d.ts +1 -1
- package/dist/monitoring/opentelemetry/instrumentation/configs/amqplib.js +7 -6
- package/dist/monitoring/opentelemetry/instrumentation/configs/amqplib.js.map +1 -1
- package/dist/monitoring/opentelemetry/instrumentation/configs/aws-sdk.d.ts +1 -1
- package/dist/monitoring/opentelemetry/instrumentation/configs/aws-sdk.js +2 -2
- package/dist/monitoring/opentelemetry/instrumentation/configs/aws-sdk.js.map +1 -1
- package/dist/monitoring/opentelemetry/instrumentation/index.d.ts +3 -4
- package/dist/monitoring/opentelemetry/instrumentation/index.js +5 -7
- package/dist/monitoring/opentelemetry/instrumentation/index.js.map +1 -1
- package/dist/monitoring/opentelemetry/trace-provider.js +6 -6
- package/dist/monitoring/opentelemetry/trace-provider.js.map +1 -1
- package/dist/output-gateway/Utils.js +1 -1
- package/dist/output-gateway/Utils.js.map +1 -1
- package/package.json +15 -14
|
@@ -3,11 +3,17 @@ import amqplib from "amqplib";
|
|
|
3
3
|
export declare class QueueProcessor {
|
|
4
4
|
protected channel: amqplib.Channel;
|
|
5
5
|
private definition;
|
|
6
|
+
private consumers;
|
|
7
|
+
private isGracefulShutdown;
|
|
6
8
|
constructor(channel: amqplib.Channel, definition: IQueueDefinition);
|
|
7
9
|
/**
|
|
8
10
|
* Registering all queues from definition
|
|
9
11
|
*/
|
|
10
12
|
registerQueues: () => Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Cancel all registered consumers before shutting down
|
|
15
|
+
*/
|
|
16
|
+
cancelConsumers: () => Promise<void>;
|
|
11
17
|
/**
|
|
12
18
|
* Default queue processor
|
|
13
19
|
*/
|
|
@@ -33,7 +33,7 @@ class QueueProcessor {
|
|
|
33
33
|
// default processor
|
|
34
34
|
yield this.defaultProcessor(msg, q.name, () => __awaiter(this, void 0, void 0, function* () {
|
|
35
35
|
if (!q.worker || !q.workerMethod) {
|
|
36
|
-
throw new errors_1.CustomError("[AMQP] Worker and worker method must be defined.", false, this.constructor.name, 5005);
|
|
36
|
+
throw new errors_1.CustomError("[AMQP QueueProcessor] Worker and worker method must be defined.", false, this.constructor.name, 5005);
|
|
37
37
|
}
|
|
38
38
|
const w = new q.worker();
|
|
39
39
|
yield (0, sentry_transactions_1.withSentryConsumerTrace)(w[q.workerMethod].bind(w))(msg);
|
|
@@ -43,12 +43,29 @@ class QueueProcessor {
|
|
|
43
43
|
});
|
|
44
44
|
yield Promise.all(promises);
|
|
45
45
|
});
|
|
46
|
+
/**
|
|
47
|
+
* Cancel all registered consumers before shutting down
|
|
48
|
+
*/
|
|
49
|
+
this.cancelConsumers = () => __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
helpers_1.log.info("[AMQP QueueProcessor] Expecting a shutdown. Cancelling all consumer operations");
|
|
51
|
+
this.isGracefulShutdown = true;
|
|
52
|
+
// Cancel all consumer operations
|
|
53
|
+
for (const consumerTag of this.consumers.values()) {
|
|
54
|
+
yield this.channel.cancel(consumerTag);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
46
57
|
/**
|
|
47
58
|
* Default queue processor
|
|
48
59
|
*/
|
|
49
60
|
this.defaultProcessor = (msg, name, worker) => __awaiter(this, void 0, void 0, function* () {
|
|
50
61
|
try {
|
|
51
62
|
helpers_1.log.verbose("[>] " + this.definition.queuePrefix + "." + name + ": received some data.");
|
|
63
|
+
// Expect to requeue the message before shutting down
|
|
64
|
+
if (this.isGracefulShutdown) {
|
|
65
|
+
this.channel.nack(msg, false, true);
|
|
66
|
+
helpers_1.log.verbose("[<] " + this.definition.queuePrefix + "." + name + ": requeued");
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
52
69
|
yield worker();
|
|
53
70
|
this.channel.ack(msg);
|
|
54
71
|
helpers_1.log.verbose("[<] " + this.definition.queuePrefix + "." + name + ": done");
|
|
@@ -83,10 +100,13 @@ class QueueProcessor {
|
|
|
83
100
|
yield this.channel.bindQueue(q.queue, config_1.config.RABBIT_EXCHANGE_NAME, key);
|
|
84
101
|
helpers_1.log.verbose("[*] Waiting for messages in " + name + ". {key " + key + "}");
|
|
85
102
|
// Listen and consume messages in queue
|
|
86
|
-
yield this.channel.consume(name, processor, { noAck: false });
|
|
103
|
+
const { consumerTag } = yield this.channel.consume(name, processor, { noAck: false });
|
|
104
|
+
this.consumers.add(consumerTag);
|
|
87
105
|
});
|
|
88
106
|
this.channel = channel;
|
|
89
107
|
this.definition = definition;
|
|
108
|
+
this.consumers = new Set();
|
|
109
|
+
this.isGracefulShutdown = false;
|
|
90
110
|
}
|
|
91
111
|
}
|
|
92
112
|
exports.QueueProcessor = QueueProcessor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueueProcessor.js","sourceRoot":"","sources":["../../../src/integration-engine/queueprocessors/QueueProcessor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uHAA0F;AAC1F,sCAAoC;AACpC,wCAAuF;AAEvF,qFAAiF;AACjF,4CAA8C;AAG9C,MAAa,cAAc;
|
|
1
|
+
{"version":3,"file":"QueueProcessor.js","sourceRoot":"","sources":["../../../src/integration-engine/queueprocessors/QueueProcessor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uHAA0F;AAC1F,sCAAoC;AACpC,wCAAuF;AAEvF,qFAAiF;AACjF,4CAA8C;AAG9C,MAAa,cAAc;IAMvB,YAAY,OAAwB,EAAE,UAA4B;QAOlE;;WAEG;QACI,mBAAc,GAAG,GAAwB,EAAE;YAC9C,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,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,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,EAAE,CAAC;QAC3B,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;IACpC,CAAC;CA4GJ;AAvHD,wCAuHC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AmqplibInstrumentationConfig } from "opentelemetry
|
|
1
|
+
import { AmqplibInstrumentationConfig } from "@opentelemetry/instrumentation-amqplib";
|
|
2
2
|
export declare const amqplibConfig: AmqplibInstrumentationConfig;
|
|
@@ -3,15 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.amqplibConfig = void 0;
|
|
4
4
|
const helpers_1 = require("../helpers");
|
|
5
5
|
const extended_attributes_1 = require("../extended-attributes");
|
|
6
|
-
const amqplibConsumeEndHook = (span,
|
|
7
|
-
span.setAttribute(extended_attributes_1.AmqplibExtendedAttribute.CONSUME_END_OPERATION, endOperation);
|
|
6
|
+
const amqplibConsumeEndHook = (span, consumeEndInfo) => {
|
|
7
|
+
span.setAttribute(extended_attributes_1.AmqplibExtendedAttribute.CONSUME_END_OPERATION, consumeEndInfo.endOperation);
|
|
8
8
|
};
|
|
9
|
-
const amqplibPublishCustomAttributeFunction = (span,
|
|
10
|
-
const module =
|
|
9
|
+
const amqplibPublishCustomAttributeFunction = (span, publishInfo) => {
|
|
10
|
+
const module = publishInfo.routingKey.split(".").slice(-2, -1)[0];
|
|
11
11
|
span.setAttribute("service.module", module);
|
|
12
12
|
};
|
|
13
|
-
const amqplibConsumerCustomAttributeFunction = (span,
|
|
14
|
-
|
|
13
|
+
const amqplibConsumerCustomAttributeFunction = (span, consumeInfo) => {
|
|
14
|
+
var _a;
|
|
15
|
+
const module = (_a = consumeInfo.msg) === null || _a === void 0 ? void 0 : _a.fields.routingKey.split(".").slice(-2, -1)[0];
|
|
15
16
|
if (module) {
|
|
16
17
|
span.setAttribute("service.module", module);
|
|
17
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"amqplib.js","sourceRoot":"","sources":["../../../../../src/monitoring/opentelemetry/instrumentation/configs/amqplib.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"amqplib.js","sourceRoot":"","sources":["../../../../../src/monitoring/opentelemetry/instrumentation/configs/amqplib.ts"],"names":[],"mappings":";;;AAUA,wCAA+C;AAC/C,gEAAkE;AAElE,MAAM,qBAAqB,GAA6C,CAAC,IAAU,EAAE,cAA8B,EAAQ,EAAE;IACzH,IAAI,CAAC,YAAY,CAAC,8CAAwB,CAAC,qBAAqB,EAAE,cAAc,CAAC,YAAY,CAAC,CAAC;AACnG,CAAC,CAAC;AAEF,MAAM,qCAAqC,GAA0C,CACjF,IAAU,EACV,WAAwB,EACpB,EAAE;IACN,MAAM,MAAM,GAAG,WAAW,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAClE,IAAI,CAAC,YAAY,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;AAChD,CAAC,CAAC;AAEF,MAAM,sCAAsC,GAA0C,CAClF,IAAU,EACV,WAEC,EACG,EAAE;;IACN,MAAM,MAAM,GAAG,MAAA,WAAW,CAAC,GAAG,0CAAE,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9E,IAAI,MAAM,EAAE;QACR,IAAI,CAAC,YAAY,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;KAC/C;AACL,CAAC,CAAC;AAEW,QAAA,aAAa,GAAiC;IACvD,WAAW,EAAE,IAAA,2BAAiB,EAAC,sCAAsC,CAAC;IACtE,WAAW,EAAE,IAAA,2BAAiB,EAAC,qCAAqC,CAAC;IACrE,cAAc,EAAE,IAAA,2BAAiB,EAAC,qBAAqB,CAAC;CAC3D,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AwsSdkInstrumentationConfig } from "opentelemetry
|
|
1
|
+
import { AwsSdkInstrumentationConfig } from "@opentelemetry/instrumentation-aws-sdk";
|
|
2
2
|
export declare const awsSdkConfig: AwsSdkInstrumentationConfig;
|
|
@@ -18,8 +18,8 @@ const getWhitelistedParams = (serviceName, requestParams) => {
|
|
|
18
18
|
return whiteList;
|
|
19
19
|
}, {});
|
|
20
20
|
};
|
|
21
|
-
const awsSdkPreRequestHook = (span,
|
|
22
|
-
const paramsToAttach = getWhitelistedParams(request.serviceName, request.commandInput);
|
|
21
|
+
const awsSdkPreRequestHook = (span, requestInfo) => {
|
|
22
|
+
const paramsToAttach = getWhitelistedParams(requestInfo.request.serviceName, requestInfo.request.commandInput);
|
|
23
23
|
if (paramsToAttach) {
|
|
24
24
|
try {
|
|
25
25
|
span.setAttribute(extended_attributes_1.AwsSdkExtendedAttribute.AWS_REQUEST_PARAMS, JSON.stringify(paramsToAttach));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aws-sdk.js","sourceRoot":"","sources":["../../../../../src/monitoring/opentelemetry/instrumentation/configs/aws-sdk.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"aws-sdk.js","sourceRoot":"","sources":["../../../../../src/monitoring/opentelemetry/instrumentation/configs/aws-sdk.ts"],"names":[],"mappings":";;;AAMA,wCAA+C;AAC/C,gEAAiE;AAEjE,MAAM,sBAAsB,GAA6B;IACrD,EAAE,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,qBAAqB,CAAC;CAC9D,CAAC;AAEF,MAAM,oBAAoB,GAAG,CAAC,WAAmB,EAAE,aAAkC,EAAmC,EAAE;IACtH,MAAM,MAAM,GAAa,sBAAsB,CAAC,WAAW,CAAC,CAAC;IAE7D,IAAI,CAAC,MAAM,IAAI,CAAC,aAAa;QAAE,OAAO;IAEtC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,SAA8B,EAAE,SAAiB,EAAE,EAAE;QACvE,MAAM,GAAG,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC;QACrC,IAAI,GAAG,KAAK,SAAS,EAAE;YACnB,SAAS,CAAC,SAAS,CAAC,GAAG,GAAG,CAAC;SAC9B;QACD,OAAO,SAAS,CAAC;IACrB,CAAC,EAAE,EAAE,CAAC,CAAC;AACX,CAAC,CAAC;AAEF,MAAM,oBAAoB,GAAyC,CAAC,IAAU,EAAE,WAAyC,EAAE,EAAE;IACzH,MAAM,cAAc,GAAG,oBAAoB,CAAC,WAAW,CAAC,OAAO,CAAC,WAAW,EAAE,WAAW,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/G,IAAI,cAAc,EAAE;QAChB,IAAI;YACA,IAAI,CAAC,YAAY,CAAC,6CAAuB,CAAC,kBAAkB,EAAE,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC;SACjG;QAAC,WAAM;YACJ,SAAS;SACZ;KACJ;AACL,CAAC,CAAC;AAEW,QAAA,YAAY,GAAgC;IACrD,cAAc,EAAE,IAAA,2BAAiB,EAAC,oBAAoB,CAAC;IACvD,+BAA+B,EAAE,IAAI;CACxC,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { HttpInstrumentation } from "@opentelemetry/instrumentation-http";
|
|
2
1
|
import { IORedisInstrumentation } from "@opentelemetry/instrumentation-ioredis";
|
|
3
2
|
import { RedisInstrumentation } from "@opentelemetry/instrumentation-redis";
|
|
4
3
|
import { ExpressInstrumentation } from "@opentelemetry/instrumentation-express";
|
|
5
4
|
import { SequelizeInstrumentation } from "opentelemetry-instrumentation-sequelize";
|
|
6
5
|
import { MongooseInstrumentation } from "opentelemetry-instrumentation-mongoose";
|
|
7
|
-
import { AmqplibInstrumentation } from "opentelemetry
|
|
8
|
-
import { AwsInstrumentation } from "opentelemetry
|
|
9
|
-
export declare const getInstrumentation: () => (ExpressInstrumentation |
|
|
6
|
+
import { AmqplibInstrumentation } from "@opentelemetry/instrumentation-amqplib";
|
|
7
|
+
import { AwsInstrumentation } from "@opentelemetry/instrumentation-aws-sdk";
|
|
8
|
+
export declare const getInstrumentation: () => (ExpressInstrumentation | SequelizeInstrumentation | MongooseInstrumentation | AmqplibInstrumentation | IORedisInstrumentation | RedisInstrumentation | AwsInstrumentation)[];
|
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getInstrumentation = void 0;
|
|
4
|
-
// Instrumentation
|
|
5
|
-
const instrumentation_http_1 = require("@opentelemetry/instrumentation-http");
|
|
6
4
|
const instrumentation_ioredis_1 = require("@opentelemetry/instrumentation-ioredis");
|
|
7
5
|
const instrumentation_redis_1 = require("@opentelemetry/instrumentation-redis");
|
|
8
6
|
const instrumentation_express_1 = require("@opentelemetry/instrumentation-express");
|
|
9
7
|
const opentelemetry_instrumentation_sequelize_1 = require("opentelemetry-instrumentation-sequelize");
|
|
10
8
|
const opentelemetry_instrumentation_mongoose_1 = require("opentelemetry-instrumentation-mongoose");
|
|
11
|
-
const
|
|
12
|
-
const
|
|
9
|
+
const instrumentation_amqplib_1 = require("@opentelemetry/instrumentation-amqplib");
|
|
10
|
+
const instrumentation_aws_sdk_1 = require("@opentelemetry/instrumentation-aws-sdk");
|
|
13
11
|
// Configs
|
|
14
12
|
const configs_1 = require("./configs");
|
|
15
13
|
const getInstrumentation = () => {
|
|
16
14
|
return [
|
|
17
15
|
new instrumentation_express_1.ExpressInstrumentation(),
|
|
18
|
-
new
|
|
16
|
+
// new HttpInstrumentation(httpConfig),
|
|
19
17
|
new opentelemetry_instrumentation_sequelize_1.SequelizeInstrumentation(configs_1.sequelizeConfig),
|
|
20
18
|
new opentelemetry_instrumentation_mongoose_1.MongooseInstrumentation(configs_1.mongooseConfig),
|
|
21
|
-
new
|
|
19
|
+
new instrumentation_amqplib_1.AmqplibInstrumentation(configs_1.amqplibConfig),
|
|
22
20
|
new instrumentation_ioredis_1.IORedisInstrumentation(),
|
|
23
21
|
new instrumentation_redis_1.RedisInstrumentation(),
|
|
24
|
-
new
|
|
22
|
+
new instrumentation_aws_sdk_1.AwsInstrumentation(configs_1.awsSdkConfig),
|
|
25
23
|
];
|
|
26
24
|
};
|
|
27
25
|
exports.getInstrumentation = getInstrumentation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/monitoring/opentelemetry/instrumentation/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/monitoring/opentelemetry/instrumentation/index.ts"],"names":[],"mappings":";;;AAEA,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,uCAAuC;QACvC,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"}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createChildSpan = exports.initTraceProvider = exports.JaegerProcessorType = void 0;
|
|
4
4
|
const instrumentation_1 = require("@opentelemetry/instrumentation");
|
|
5
|
-
const
|
|
5
|
+
const sdk_trace_node_1 = require("@opentelemetry/sdk-trace-node");
|
|
6
6
|
const resources_1 = require("@opentelemetry/resources");
|
|
7
7
|
const semantic_conventions_1 = require("@opentelemetry/semantic-conventions");
|
|
8
|
-
const
|
|
8
|
+
const sdk_trace_base_1 = require("@opentelemetry/sdk-trace-base");
|
|
9
9
|
const exporter_jaeger_1 = require("@opentelemetry/exporter-jaeger");
|
|
10
10
|
const api_1 = require("@opentelemetry/api");
|
|
11
11
|
const instrumentation_2 = require("./instrumentation");
|
|
@@ -24,24 +24,24 @@ const initTraceProvider = (projectName, nodeEnv, config) => {
|
|
|
24
24
|
else {
|
|
25
25
|
api_1.diag.info(`Telemetry enabled (env: ${nodeEnv})`);
|
|
26
26
|
}
|
|
27
|
-
const provider = new
|
|
27
|
+
const provider = new sdk_trace_node_1.NodeTracerProvider({
|
|
28
28
|
resource: new resources_1.Resource({
|
|
29
29
|
[semantic_conventions_1.SemanticResourceAttributes.SERVICE_NAME]: projectName,
|
|
30
30
|
}),
|
|
31
31
|
});
|
|
32
32
|
if (config.jaegerProcessor === JaegerProcessorType.CONSOLE || config.jaegerProcessor === JaegerProcessorType.BOTH) {
|
|
33
|
-
provider.addSpanProcessor(new
|
|
33
|
+
provider.addSpanProcessor(new sdk_trace_base_1.SimpleSpanProcessor(new sdk_trace_base_1.ConsoleSpanExporter()));
|
|
34
34
|
}
|
|
35
35
|
if (config.jaegerProcessor === JaegerProcessorType.EXPORTER || config.jaegerProcessor === JaegerProcessorType.BOTH) {
|
|
36
36
|
const options = config.jaegerEndpoint
|
|
37
37
|
? { endpoint: config.jaegerEndpoint }
|
|
38
38
|
: Object.assign(Object.assign({}, (config.jaegerHost && { host: config.jaegerHost })), (config.jaegerPort && { port: config.jaegerPort }));
|
|
39
|
-
provider.addSpanProcessor(new
|
|
39
|
+
provider.addSpanProcessor(new sdk_trace_base_1.BatchSpanProcessor(new exporter_jaeger_1.JaegerExporter(options)));
|
|
40
40
|
}
|
|
41
41
|
provider.register();
|
|
42
42
|
(0, instrumentation_1.registerInstrumentations)({
|
|
43
43
|
tracerProvider: provider,
|
|
44
|
-
instrumentations:
|
|
44
|
+
instrumentations: (0, instrumentation_2.getInstrumentation)(),
|
|
45
45
|
});
|
|
46
46
|
};
|
|
47
47
|
exports.initTraceProvider = initTraceProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trace-provider.js","sourceRoot":"","sources":["../../../src/monitoring/opentelemetry/trace-provider.ts"],"names":[],"mappings":";;;AAAA,oEAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"trace-provider.js","sourceRoot":"","sources":["../../../src/monitoring/opentelemetry/trace-provider.ts"],"names":[],"mappings":";;;AAAA,oEAA0E;AAC1E,kEAAmE;AACnE,wDAAoD;AACpD,8EAAiF;AACjF,kEAA6G;AAC7G,oEAAgF;AAChF,4CAAwF;AACxF,uDAA+E;AAE/E,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC3B,0CAAmB,CAAA;IACnB,4CAAqB,CAAA;IACrB,oCAAa,CAAA;AACjB,CAAC,EAJW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAI9B;AAWM,MAAM,iBAAiB,GAAG,CAAC,WAAmB,EAAE,OAAe,EAAE,MAAqB,EAAE,EAAE;IAC7F,UAAI,CAAC,SAAS,CAAC,IAAI,uBAAiB,EAAE,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;IAE7D,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE;QACvB,UAAI,CAAC,IAAI,CAAC,4BAA4B,OAAO,GAAG,CAAC,CAAC;QAClD,OAAO;KACV;SAAM;QACH,UAAI,CAAC,IAAI,CAAC,2BAA2B,OAAO,GAAG,CAAC,CAAC;KACpD;IAED,MAAM,QAAQ,GAAuB,IAAI,mCAAkB,CAAC;QACxD,QAAQ,EAAE,IAAI,oBAAQ,CAAC;YACnB,CAAC,iDAA0B,CAAC,YAAY,CAAC,EAAE,WAAW;SACzD,CAAC;KACL,CAAC,CAAC;IAEH,IAAI,MAAM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-1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../src/output-gateway/Utils.ts"],"names":[],"mappings":";;;AAAO,MAAM,cAAc,GAAG,CAAI,IAAY,EAAE,GAAW,EAAK,EAAE;IAC9D,IAAI,IAAI,KAAK,EAAE,EAAE;QACb,OAAO,GAAmB,CAAC;KAC9B;SAAM;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,IAAS,EAAE,IAAS,EAAE,EAAE;YACnD,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACzC,CAAC,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../src/output-gateway/Utils.ts"],"names":[],"mappings":";;;AAAO,MAAM,cAAc,GAAG,CAAI,IAAY,EAAE,GAAW,EAAK,EAAE;IAC9D,IAAI,IAAI,KAAK,EAAE,EAAE;QACb,OAAO,GAAmB,CAAC;KAC9B;SAAM;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,IAAS,EAAE,IAAS,EAAE,EAAE;YACnD,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACzC,CAAC,EAAE,GAAG,CAAC,CAAC;KACX;AACL,CAAC,CAAC;AARW,QAAA,cAAc,kBAQzB;AAEF;;;;GAIG;AACI,MAAM,sBAAsB,GAAG,CAAC,KAAyB,EAAW,EAAE;IACzE,IAAI,KAAK,KAAK,SAAS,EAAE;QACrB,OAAO,KAAK,CAAC;KAChB;SAAM;QACH,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;KAC/D;AACL,CAAC,CAAC;AANW,QAAA,sBAAsB,0BAMjC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golemio/core",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.9-dev.533136017",
|
|
4
4
|
"description": "Golemio Core Module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -72,15 +72,18 @@
|
|
|
72
72
|
"@golemio/utils": "^1.0.0",
|
|
73
73
|
"@golemio/validator": "0.2.2",
|
|
74
74
|
"@google-cloud/storage": "^5.18.0",
|
|
75
|
-
"@opentelemetry/api": "^1.0
|
|
76
|
-
"@opentelemetry/exporter-jaeger": "^
|
|
77
|
-
"@opentelemetry/instrumentation-
|
|
78
|
-
"@opentelemetry/instrumentation-
|
|
79
|
-
"@opentelemetry/instrumentation-
|
|
80
|
-
"@opentelemetry/instrumentation-
|
|
81
|
-
"@opentelemetry/
|
|
82
|
-
"@opentelemetry/
|
|
83
|
-
"@opentelemetry/
|
|
75
|
+
"@opentelemetry/api": "^1.1.0",
|
|
76
|
+
"@opentelemetry/exporter-jaeger": "^1.2.0",
|
|
77
|
+
"@opentelemetry/instrumentation-amqplib": "^0.28.0",
|
|
78
|
+
"@opentelemetry/instrumentation-aws-sdk": "^0.6.0",
|
|
79
|
+
"@opentelemetry/instrumentation-express": "^0.28.0",
|
|
80
|
+
"@opentelemetry/instrumentation-http": "^0.28.0",
|
|
81
|
+
"@opentelemetry/instrumentation-ioredis": "^0.28.0",
|
|
82
|
+
"@opentelemetry/instrumentation-pg": "^0.28.0",
|
|
83
|
+
"@opentelemetry/instrumentation-redis": "^0.29.0",
|
|
84
|
+
"@opentelemetry/resources": "^1.2.0",
|
|
85
|
+
"@opentelemetry/sdk-trace-base": "^1.2.0",
|
|
86
|
+
"@opentelemetry/sdk-trace-node": "^1.2.0",
|
|
84
87
|
"@sentry/node": "^6.11.0",
|
|
85
88
|
"@sentry/tracing": "^6.11.0",
|
|
86
89
|
"@types/express": "^4.16.0",
|
|
@@ -109,10 +112,8 @@
|
|
|
109
112
|
"mongodb-restore-dump": "1.0.1",
|
|
110
113
|
"mongoose": "^5.3.6",
|
|
111
114
|
"morgan": "^1.10.0",
|
|
112
|
-
"opentelemetry-instrumentation-
|
|
113
|
-
"opentelemetry-instrumentation-
|
|
114
|
-
"opentelemetry-instrumentation-mongoose": "^0.24.0",
|
|
115
|
-
"opentelemetry-instrumentation-sequelize": "^0.24.0",
|
|
115
|
+
"opentelemetry-instrumentation-mongoose": "^0.27.1",
|
|
116
|
+
"opentelemetry-instrumentation-sequelize": "^0.27.1",
|
|
116
117
|
"path-to-regexp": "^6.2.0",
|
|
117
118
|
"pg": "^8.6.0",
|
|
118
119
|
"prom-client": "^14.0.0",
|