Skip to content

Commit

Permalink
feat: log domain every time a webhook is invoked (#7962)
Browse files Browse the repository at this point in the history
  • Loading branch information
daveleek authored Aug 22, 2024
1 parent 4a4dafc commit e13f7ee
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/lib/addons/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,21 @@ export default class Webhook extends Addon {
state = 'failed';
const failedMessage = `Webhook request failed with status code: ${res.status}.`;
stateDetails.push(failedMessage);
if (this.flagResolver.isEnabled('addonUsageMetrics')) {
this.eventBus.emit(ADDON_EVENTS_HANDLED, {
result: state,
destination: 'webhook',
});
}

this.logger.warn(failedMessage);
}

if (this.flagResolver.isEnabled('addonUsageMetrics')) {
this.eventBus.emit(ADDON_EVENTS_HANDLED, {
result: state,
destination: 'webhook',
});
}

const domain = new URL(url).hostname;
this.logger.info(`Webhook invoked`, {
domain,
});

this.registerEvent({
integrationId,
state,
Expand Down

0 comments on commit e13f7ee

Please sign in to comment.