Skip to content

Commit 4add08f

Browse files
committed
✨ add tracing logs
1 parent 524e251 commit 4add08f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/models/controller.model.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ export class Controller {
323323
throw new Error('Invalid contacts received');
324324
}
325325

326+
tracer.logInfo('Publish in Progress message');
326327
const message: PubSubContactsMessage = {
327328
userId,
328329
timestamp,
@@ -350,16 +351,17 @@ export class Controller {
350351
};
351352

352353
const streamingPromise = streamContacts()
353-
.then(() =>
354-
this.pubSubContactStreamingClient?.publishMessage({
354+
.then(() => {
355+
tracer.logInfo('Publish Complete message');
356+
return this.pubSubContactStreamingClient?.publishMessage({
355357
userId: providerConfig.userId,
356358
timestamp,
357359
contacts: [],
358360
state: PubSubContactsState.COMPLETE,
359361
integrationName: this.integrationName,
360362
traceparent: tracer.getTraceParent(),
361-
}),
362-
)
363+
});
364+
})
363365
.catch(async (error) => {
364366
tracer.setError('Could not stream contacts');
365367
errorLogger(
@@ -368,6 +370,7 @@ export class Controller {
368370
providerConfig.apiKey,
369371
error,
370372
);
373+
tracer.logWarning('Publish Failed message');
371374
return this.pubSubContactStreamingClient?.publishMessage({
372375
userId: providerConfig.userId,
373376
timestamp,

0 commit comments

Comments
 (0)