mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +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';
 | 
			
		||||
            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,
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user