mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-23 00:22:19 +01:00
feat: log domain every time a webhook is invoked (#7962)
This commit is contained in:
parent
4a4dafcc3f
commit
e13f7eea63
@ -103,16 +103,21 @@ export default class Webhook extends Addon {
|
|||||||
state = 'failed';
|
state = 'failed';
|
||||||
const failedMessage = `Webhook request failed with status code: ${res.status}.`;
|
const failedMessage = `Webhook request failed with status code: ${res.status}.`;
|
||||||
stateDetails.push(failedMessage);
|
stateDetails.push(failedMessage);
|
||||||
if (this.flagResolver.isEnabled('addonUsageMetrics')) {
|
|
||||||
this.eventBus.emit(ADDON_EVENTS_HANDLED, {
|
|
||||||
result: state,
|
|
||||||
destination: 'webhook',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
this.logger.warn(failedMessage);
|
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({
|
this.registerEvent({
|
||||||
integrationId,
|
integrationId,
|
||||||
state,
|
state,
|
||||||
|
Loading…
Reference in New Issue
Block a user