Skip to content

Commit ea47b44

Browse files
committed
logs
1 parent 2e5e29e commit ea47b44

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/ExpressBridge.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class ExpressBridge {
4242
if (process.env.EB_TELEMETRY && this.options.telemetry) {
4343
console.log('Telemetry enabled, setting trace tag on event.');
4444
this.telemetry = new Telemetry(this.options.telemetry);
45-
const tag = this.telemetry.tagEvent(incomingEvent);
45+
this.telemetry.tagEvent(incomingEvent);
4646
}
4747

4848
await this.telemetry?.beacon('EB-PROCESS', {
@@ -54,6 +54,8 @@ export class ExpressBridge {
5454

5555
const matchedPatterns = this.match(incomingEvent);
5656

57+
console.log('Patterns matched: ', matchedPatterns);
58+
5759
if (matchedPatterns.length > 0) {
5860
await this.telemetry?.beacon('EB-MATCH', {
5961
description: 'Patterns matched for event. Calling assigned handlers.',

src/Telemetry.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ export class Telemetry {
4242
for (const record of payload) {
4343
record.eb_event_id = record.eb_event_id || tag;
4444
}
45-
} else if (!payload) {
46-
event.eb_event_id = event.eb_event_id || tag;
47-
} else {
45+
} else if (payload) {
4846
payload = typeof payload === 'string' ? JSON.parse(payload) : payload;
4947
payload.eb_event_id = payload.eb_event_id || tag;
48+
} else {
49+
event.eb_event_id = event.eb_event_id || tag;
5050
}
5151

5252
this.eb_event_id = tag;

0 commit comments

Comments
 (0)