@palmetto/pubsub 2.2.3 → 2.2.4
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/publisher.js +1 -4
- package/dist/subscriber.js +4 -7
- package/package.json +1 -1
package/dist/publisher.js
CHANGED
|
@@ -55,10 +55,7 @@ class Publisher {
|
|
|
55
55
|
publish(config, message) {
|
|
56
56
|
return __awaiter(this, void 0, void 0, function* () {
|
|
57
57
|
yield (0, dd_trace_wrapper_js_1.getTracer)().trace("pubsub.publish", {
|
|
58
|
-
resource: config.name
|
|
59
|
-
tags: {
|
|
60
|
-
"pubsub.transport": config.transport,
|
|
61
|
-
},
|
|
58
|
+
resource: `publish ${config.transport} ${config.name}`,
|
|
62
59
|
}, (span) => __awaiter(this, void 0, void 0, function* () {
|
|
63
60
|
try {
|
|
64
61
|
const provider = this.getProvider(config);
|
package/dist/subscriber.js
CHANGED
|
@@ -56,12 +56,9 @@ class Subscriber {
|
|
|
56
56
|
if (!provider) {
|
|
57
57
|
throw new errors_js_1.MissingPubSubProviderError(`No provider configured for ${config.transport}`);
|
|
58
58
|
}
|
|
59
|
-
const transform = (jsonStr, context) =>
|
|
60
|
-
return
|
|
61
|
-
resource: config.name
|
|
62
|
-
tags: {
|
|
63
|
-
"pubsub.transport": config.transport,
|
|
64
|
-
},
|
|
59
|
+
const transform = (jsonStr, context) => {
|
|
60
|
+
return (0, dd_trace_wrapper_js_1.getTracer)().trace("pubsub.handleMessage", {
|
|
61
|
+
resource: `handle ${config.transport} ${config.name}`,
|
|
65
62
|
}, (span) => __awaiter(this, void 0, void 0, function* () {
|
|
66
63
|
const start = (0, message_logger_js_1.startTiming)();
|
|
67
64
|
const jsonObject = JSON.parse(jsonStr);
|
|
@@ -130,7 +127,7 @@ class Subscriber {
|
|
|
130
127
|
throw err;
|
|
131
128
|
}
|
|
132
129
|
}));
|
|
133
|
-
}
|
|
130
|
+
};
|
|
134
131
|
this.logger.log(`Starting subscriber for ${config.transport}:${config.name}`);
|
|
135
132
|
subscribedMessage = new SubscribedMessage(yield provider.startSubscribe(config, transform));
|
|
136
133
|
this.subscribedMessages.set(config, subscribedMessage);
|