@routr/dispatcher 2.0.5-alpha.12 → 2.0.5-alpha.13
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/run_middlewares.js +1 -1
- package/dist/run_processor.js +11 -0
- package/package.json +4 -3
package/dist/run_middlewares.js
CHANGED
|
@@ -51,7 +51,7 @@ function runMiddlewares(params) {
|
|
|
51
51
|
const req = Object.assign({}, request);
|
|
52
52
|
return new Promise((resolve, rejects) => __awaiter(this, void 0, void 0, function* () {
|
|
53
53
|
for (const midd of middlewares) {
|
|
54
|
-
logger_1.default.verbose("forwarding request to middleware
|
|
54
|
+
logger_1.default.verbose("forwarding request to middleware", { ref: midd.ref, addr: midd.addr });
|
|
55
55
|
// Get the next middleware
|
|
56
56
|
const conn = connections.get(midd.ref);
|
|
57
57
|
// Send message and re-insert response for next middleware
|
package/dist/run_processor.js
CHANGED
|
@@ -26,7 +26,18 @@ const errors_1 = require("./errors");
|
|
|
26
26
|
const find_processor_1 = require("./find_processor");
|
|
27
27
|
const grpc = require("@grpc/grpc-js");
|
|
28
28
|
const logger_1 = __importDefault(require("@fonoster/logger"));
|
|
29
|
+
const api_1 = __importDefault(require("@opentelemetry/api"));
|
|
30
|
+
const common_1 = require("@routr/common");
|
|
31
|
+
const tracer = common_1.Tracer.init('example-grpc-js-server');
|
|
29
32
|
function runProcessor(params) {
|
|
33
|
+
const currentSpan = api_1.default.trace.getSpan(api_1.default.context.active());
|
|
34
|
+
// display traceid in the terminal
|
|
35
|
+
logger_1.default.verbose(`traceid: ${currentSpan.spanContext().traceId}`);
|
|
36
|
+
const span = tracer.startSpan('server.js:sayHello()', {
|
|
37
|
+
kind: 1,
|
|
38
|
+
attributes: { key: 'value' },
|
|
39
|
+
});
|
|
40
|
+
span.addEvent(`invoking sayHello() to...`);
|
|
30
41
|
const { callback, connections, processors, request } = params;
|
|
31
42
|
const matchResult = find_processor_1.findProcessor(processors)(request);
|
|
32
43
|
if ('code' in matchResult) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@routr/dispatcher",
|
|
3
|
-
"version": "2.0.5-alpha.
|
|
3
|
+
"version": "2.0.5-alpha.13",
|
|
4
4
|
"description": "Receives SIP messages and forwards them to the corresponding Message Processor",
|
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
|
6
6
|
"homepage": "https://github.com/fonoster/routr#readme",
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@grpc/grpc-js": "^1.5.9",
|
|
29
|
-
"@
|
|
29
|
+
"@opentelemetry/api": "^1.1.0",
|
|
30
|
+
"@routr/common": "^2.0.5-alpha.13",
|
|
30
31
|
"ajv": "^6.12.6",
|
|
31
32
|
"fp-ts": "^2.11.8"
|
|
32
33
|
},
|
|
@@ -37,5 +38,5 @@
|
|
|
37
38
|
"bugs": {
|
|
38
39
|
"url": "https://github.com/fonoster/routr/issues"
|
|
39
40
|
},
|
|
40
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "6b2f1b6c1bd6b57ebc61189d6d198fe611790995"
|
|
41
42
|
}
|